Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve privacy #1074

Merged
merged 3 commits into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ app.on('ready', async () => {
dialog.showErrorBox(
'Daemon has Exited',
'The daemon may have encountered an unexpected error, or another daemon instance is already running. \n\n' +
'For more information please visit: \n' +
'https://lbry.io/faq/startup-troubleshooting'
'For more information please visit: \n' +
'https://lbry.io/faq/startup-troubleshooting'
);
app.quit();
}
Expand Down
11 changes: 11 additions & 0 deletions src/renderer/analytics.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// @flow
import mixpanel from 'mixpanel-browser';
import Lbryio from 'lbryio';

mixpanel.init('691723e855cabb9d27a7a79002216967');

type Analytics = {
track: (string, ?Object) => void,
setUser: Object => void,
toggle: (boolean, ?boolean) => void,
apiLog: (string, string, string) => void,
};

let analyticsEnabled: boolean = false;
Expand Down Expand Up @@ -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;
12 changes: 6 additions & 6 deletions src/renderer/component/fileList/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ class FileList extends React.PureComponent {
this._sortFunctions = {
dateNew(fileInfos) {
return fileInfos.slice().sort((fileInfo1, fileInfo2) => {
const height1 = fileInfo1.height
const height2 = fileInfo2.height
const height1 = fileInfo1.height;
const height2 = fileInfo2.height;
if (height1 > height2) {
return -1;
} else if (height1 < height2) {
return 1;
}
return 0;
});
});
},
dateOld(fileInfos) {
return fileInfos.slice().sort((fileInfo1, fileInfo2) => {
const height1 = fileInfo1.height
const height2 = fileInfo2.height
const height1 = fileInfo1.height;
const height2 = fileInfo2.height;
if (height1 < height2) {
return -1;
} else if (height1 > height2) {
return 1;
}
return 0;
});
});
},
title(fileInfos) {
return fileInfos.slice().sort((fileInfo1, fileInfo2) => {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/component/rewardSummary/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const RewardSummary = (props: Props) => {
<div className="card__title-primary">
<h3>{__('Rewards')}</h3>
<p className="help">
{__('Read our')}{' '}
<Link href="https://lbry.io/faq/rewards">{__('FAQ')}</Link>{' '}{__('to learn more about LBRY Rewards')}.
</p>
{__('Read our')} <Link href="https://lbry.io/faq/rewards">{__('FAQ')}</Link>{' '}
{__('to learn more about LBRY Rewards')}.
</p>
</div>
<div className="card__content">
{unclaimedRewardAmount > 0 ? (
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ipcRenderer.on('window-is-focused', () => {

document.addEventListener('dragover', event => {
event.preventDefault();
})
});
document.addEventListener('drop', event => {
event.preventDefault();
});
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/modal/modalEmailCollection/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/page/auth/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/page/settings/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 2 additions & 5 deletions src/renderer/redux/actions/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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;

Expand Down Expand Up @@ -226,11 +227,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());
};
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/redux/actions/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export function doUpdateIsNight() {
const momentNow = moment();
return {
type: ACTIONS.UPDATE_IS_NIGHT,
data: { isNight: (() => {
data: {
isNight: (() => {
const startNightMoment = moment('21:00', 'HH:mm');
const endNightMoment = moment('8:00', 'HH:mm');
return !(momentNow.isAfter(endNightMoment) && momentNow.isBefore(startNightMoment));
Expand Down