From 3fc653053128073e7824b6710582b65711bd258f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 24 Feb 2020 12:02:43 -0500 Subject: [PATCH] allow preventing lbryinc calls on authenticate --- dist/bundle.es.js | 11 +++++++---- dist/bundle.js | 10 +++++++--- src/redux/actions/user.js | 10 ++++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 3591283..c27bb18 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1296,7 +1296,7 @@ function doInstallNew(appVersion, os = null, firebaseToken = null) { }); } // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params? -function doAuthenticate(appVersion, os = null, firebaseToken = null) { +function doAuthenticate(appVersion, os = null, firebaseToken = null, shareUsageData = true) { return dispatch => { dispatch({ type: AUTHENTICATION_STARTED @@ -1310,9 +1310,12 @@ function doAuthenticate(appVersion, os = null, firebaseToken = null) { accessToken: token } }); - dispatch(doRewardList()); - dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os, firebaseToken); + + if (shareUsageData) { + dispatch(doRewardList()); + dispatch(doFetchInviteStatus()); + doInstallNew(appVersion, os, firebaseToken); + } }); }).catch(error => { dispatch({ diff --git a/dist/bundle.js b/dist/bundle.js index 2834354..fcb27a5 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -4927,6 +4927,7 @@ function doInstallNew(appVersion) { function doAuthenticate(appVersion) { var os = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var firebaseToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var shareUsageData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; return function (dispatch) { dispatch({ type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["AUTHENTICATION_STARTED"] @@ -4940,9 +4941,12 @@ function doAuthenticate(appVersion) { accessToken: token } }); - dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])()); - dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os, firebaseToken); + + if (shareUsageData) { + dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])()); + dispatch(doFetchInviteStatus()); + doInstallNew(appVersion, os, firebaseToken); + } }); })["catch"](function (error) { dispatch({ diff --git a/src/redux/actions/user.js b/src/redux/actions/user.js index 54afc30..80b3c6d 100644 --- a/src/redux/actions/user.js +++ b/src/redux/actions/user.js @@ -64,7 +64,7 @@ export function doInstallNew(appVersion, os = null, firebaseToken = null) { } // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params? -export function doAuthenticate(appVersion, os = null, firebaseToken = null) { +export function doAuthenticate(appVersion, os = null, firebaseToken = null, shareUsageData = true) { return dispatch => { dispatch({ type: ACTIONS.AUTHENTICATION_STARTED, @@ -78,9 +78,11 @@ export function doAuthenticate(appVersion, os = null, firebaseToken = null) { data: { user, accessToken: token }, }); - dispatch(doRewardList()); - dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os, firebaseToken); + if (shareUsageData) { + dispatch(doRewardList()); + dispatch(doFetchInviteStatus()); + doInstallNew(appVersion, os, firebaseToken); + } }); }) .catch(error => {