Merge pull request #1074 from lbryio/improve-privacy

Improve privacy
This commit is contained in:
Liam Cardenas 2018-03-07 21:24:29 -08:00 committed by GitHub
commit 183c4be58b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 8 deletions

View file

@ -1,5 +1,6 @@
// @flow
import mixpanel from 'mixpanel-browser';
import Lbryio from 'lbryio';
mixpanel.init('691723e855cabb9d27a7a79002216967');
@ -7,6 +8,7 @@ type Analytics = {
track: (string, ?Object) => void,
setUser: Object => void,
toggle: (boolean, ?boolean) => void,
apiLog: (string, string, string) => void,
};
let analyticsEnabled: boolean = false;
@ -37,6 +39,15 @@ const analytics: Analytics = {
}
analyticsEnabled = enabled;
},
apiLog: (uri: string, outpoint: string, claimId: string): void => {
if (analyticsEnabled) {
Lbryio.call('file', 'view', {
uri,
outpoint,
claim_id: claimId,
}).catch(() => {});
}
},
};
export default analytics;

View file

@ -30,7 +30,12 @@ class ModalEmailCollection extends React.PureComponent {
<Modal type="custom" isOpen contentLabel="Email">
<section>
<h3 className="modal__header">Can We Stay In Touch?</h3>
{this.renderInner()}
<div className="card__content">{this.renderInner()}</div>
<div className="card__content">
<div className="help">
{`${__('Your email may be used to sync usage data across devices.')} `}
</div>
</div>
</section>
</Modal>
);

View file

@ -68,7 +68,7 @@ export class AuthPage extends React.PureComponent {
<div className="card__content">
<div className="help">
{`${__(
'This information is disclosed only to LBRY, Inc. and not to the LBRY network. It is only required to earn LBRY rewards.'
'This information is disclosed only to LBRY, Inc. and not to the LBRY network. It is only required to earn LBRY rewards and may be used to sync usage data across devices.'
)} `}
<Link onClick={() => navigate('/discover')} label={__('Return home')} />.
</div>

View file

@ -308,7 +308,9 @@ class SettingsPage extends React.PureComponent {
type="checkbox"
onChange={this.onShareDataChange.bind(this)}
defaultChecked={daemonSettings.share_usage_data}
label={__('Help make LBRY better by contributing diagnostic data about my usage')}
label={__(
'Help make LBRY better by contributing analytics and diagnostic data and about my usage'
)}
/>
</div>
</section>

View file

@ -22,6 +22,7 @@ import { selectBalance } from 'redux/selectors/wallet';
import batchActions from 'util/batchActions';
import setBadge from 'util/setBadge';
import setProgressBar from 'util/setProgressBar';
import analytics from 'analytics';
const DOWNLOAD_POLL_INTERVAL = 250;
@ -227,11 +228,7 @@ export function doDownloadFile(uri, streamInfo) {
return dispatch => {
dispatch(doStartDownload(uri, streamInfo.outpoint));
Lbryio.call('file', 'view', {
uri,
outpoint: streamInfo.outpoint,
claim_id: streamInfo.claim_id,
}).catch(() => {});
analytics.apiLog(uri, streamInfo.output, streamInfo.claim_id);
dispatch(doClaimEligiblePurchaseRewards());
};