diff --git a/src/main/index.js b/src/main/index.js index d068e87e0ef..ec468ae700e 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -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(); } diff --git a/src/renderer/analytics.js b/src/renderer/analytics.js index c0fd82f1373..a52b4665177 100644 --- a/src/renderer/analytics.js +++ b/src/renderer/analytics.js @@ -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; diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx index afb446323b9..eef0993c6e1 100644 --- a/src/renderer/component/fileList/view.jsx +++ b/src/renderer/component/fileList/view.jsx @@ -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) => { diff --git a/src/renderer/component/rewardSummary/view.jsx b/src/renderer/component/rewardSummary/view.jsx index 36507d53522..9fa6119027f 100644 --- a/src/renderer/component/rewardSummary/view.jsx +++ b/src/renderer/component/rewardSummary/view.jsx @@ -15,9 +15,9 @@ const RewardSummary = (props: Props) => {

{__('Rewards')}

- {__('Read our')}{' '} - {__('FAQ')}{' '}{__('to learn more about LBRY Rewards')}. -

+ {__('Read our')} {__('FAQ')}{' '} + {__('to learn more about LBRY Rewards')}. +

{unclaimedRewardAmount > 0 ? ( diff --git a/src/renderer/index.js b/src/renderer/index.js index 822f0b153a3..c1edc127118 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -69,7 +69,7 @@ ipcRenderer.on('window-is-focused', () => { document.addEventListener('dragover', event => { event.preventDefault(); -}) +}); document.addEventListener('drop', event => { event.preventDefault(); }); diff --git a/src/renderer/modal/modalEmailCollection/view.jsx b/src/renderer/modal/modalEmailCollection/view.jsx index a17ecf7df6f..1418114d3d2 100644 --- a/src/renderer/modal/modalEmailCollection/view.jsx +++ b/src/renderer/modal/modalEmailCollection/view.jsx @@ -30,7 +30,12 @@ class ModalEmailCollection extends React.PureComponent {

Can We Stay In Touch?

- {this.renderInner()} +
{this.renderInner()}
+
+
+ {`${__('Your email may be used to sync usage data across devices.')} `} +
+
); diff --git a/src/renderer/page/auth/view.jsx b/src/renderer/page/auth/view.jsx index 423ce8597e7..6a7052343fa 100644 --- a/src/renderer/page/auth/view.jsx +++ b/src/renderer/page/auth/view.jsx @@ -68,7 +68,7 @@ export class AuthPage extends React.PureComponent {
{`${__( - '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.' )} `} navigate('/discover')} label={__('Return home')} />.
diff --git a/src/renderer/page/settings/view.jsx b/src/renderer/page/settings/view.jsx index d2a22db0346..fe704b906ef 100644 --- a/src/renderer/page/settings/view.jsx +++ b/src/renderer/page/settings/view.jsx @@ -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' + )} />
diff --git a/src/renderer/redux/actions/content.js b/src/renderer/redux/actions/content.js index 2ca2c4dbba6..8231f41ab3f 100644 --- a/src/renderer/redux/actions/content.js +++ b/src/renderer/redux/actions/content.js @@ -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; @@ -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()); }; diff --git a/src/renderer/redux/actions/settings.js b/src/renderer/redux/actions/settings.js index da4ed52a0a3..db3fa502002 100644 --- a/src/renderer/redux/actions/settings.js +++ b/src/renderer/redux/actions/settings.js @@ -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));