Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
/ Orion Public archive

Commit

Permalink
Merge pull request #147 from Siderus/feature/stats-user-activities
Browse files Browse the repository at this point in the history
Adds more stats about file size (if big) and window Activities
  • Loading branch information
koalalorenzo authored Jul 5, 2018
2 parents 2dd1a12 + bca23bb commit 935440b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions app/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ export function addFilesFromFSPath (filePaths, _queryGateways = queryGateways) {
const filename = parse(path).base
const uuid = uuidv4()

// when uploading big files we want to show the progress in the activities window
// when uploading big files we want to show the progress in the activities
// window
if (size >= ACTIVITIES_WINDOW_THRESHOLD) {
app.emit('show-activities-window')
trackEvent('BigFileAdded', {size})
}

/**
* The fuction we pass under `progress` will be called with the byte length of chunks
* as they are added to IPFS
* The fuction we pass under `progress` will be called with the byte length
* of chunks as they are added to IPFS
*/
const options = {
recursive: true,
Expand Down
2 changes: 2 additions & 0 deletions app/windows/Activities/renderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Window, Toolbar, Actionbar } from 'react-photonkit'
import Button from '../../components/Button'
import { ipcRenderer } from 'electron'
import ActivityList from './Components/ActivityList'
import { trackEvent } from '../../stats'

// This will store the loop's timeout ID
window.loopTimeoutID = null
Expand All @@ -15,6 +16,7 @@ class ActivitiesWindow extends React.Component {
}

componentDidMount () {
trackEvent('ActivitiesWindowOpen', {})
ipcRenderer.on('update', (event, data) => {
this.data = data
})
Expand Down
2 changes: 1 addition & 1 deletion app/windows/Welcome/Components/StatsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class StatsPage extends React.Component {
<li>An unique random ID generated on the first usage</li>
<li>Features used (Windows, Screens and Sessions)</li>
<li>Operative System and release/version</li>
<li>Amount of files shared, NOT the hashes</li>
<li>Amount of files shared and the size, NOT the hashes/content</li>
</ul>
You can opt-in as well as opt out at any time from the Settings.<br />
<br />
Expand Down

0 comments on commit 935440b

Please sign in to comment.