diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 9967b3a..a844ac2 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1275,7 +1275,7 @@ function doFetchInviteStatus() { }); }; } -function doInstallNew(appVersion, os = null, firebaseToken = null) { +function doInstallNew(appVersion, os = null, firebaseToken = null, callbackForUsersWhoAreSharingData) { const payload = { app_version: appVersion }; @@ -1292,11 +1292,15 @@ function doInstallNew(appVersion, os = null, firebaseToken = null) { payload.operating_system = os || version.os_system; payload.platform = version.platform; Lbryio.call('install', 'new', payload); + + if (callbackForUsersWhoAreSharingData) { + callbackForUsersWhoAreSharingData(status); + } }); }); } // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params? -function doAuthenticate(appVersion, os = null, firebaseToken = null, shareUsageData = true) { +function doAuthenticate(appVersion, os = null, firebaseToken = null, shareUsageData = true, callbackForUsersWhoAreSharingData) { return dispatch => { dispatch({ type: AUTHENTICATION_STARTED @@ -1314,7 +1318,7 @@ function doAuthenticate(appVersion, os = null, firebaseToken = null, shareUsageD if (shareUsageData) { dispatch(doRewardList()); dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os, firebaseToken); + doInstallNew(appVersion, os, firebaseToken, callbackForUsersWhoAreSharingData); } }); }).catch(error => { @@ -2698,7 +2702,6 @@ function doGetSync(passedPassword, callback) { } handleCallback(syncAttemptError); - return; } else if (data.hasSyncedWallet) { const error = 'Error getting synced wallet'; dispatch({ diff --git a/dist/bundle.js b/dist/bundle.js index 298d1ba..8614884 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -4904,6 +4904,7 @@ function doFetchInviteStatus() { function doInstallNew(appVersion) { var os = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var firebaseToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var callbackForUsersWhoAreSharingData = arguments.length > 3 ? arguments[3] : undefined; var payload = { app_version: appVersion }; @@ -4920,6 +4921,10 @@ function doInstallNew(appVersion) { payload.operating_system = os || version.os_system; payload.platform = version.platform; lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('install', 'new', payload); + + if (callbackForUsersWhoAreSharingData) { + callbackForUsersWhoAreSharingData(status); + } }); }); } // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params? @@ -4928,6 +4933,7 @@ 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; + var callbackForUsersWhoAreSharingData = arguments.length > 4 ? arguments[4] : undefined; return function (dispatch) { dispatch({ type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["AUTHENTICATION_STARTED"] @@ -4945,7 +4951,7 @@ function doAuthenticate(appVersion) { if (shareUsageData) { dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])()); dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os, firebaseToken); + doInstallNew(appVersion, os, firebaseToken, callbackForUsersWhoAreSharingData); } }); })["catch"](function (error) { @@ -6467,7 +6473,6 @@ function doGetSync(passedPassword, callback) { } handleCallback(syncAttemptError); - return; } else if (data.hasSyncedWallet) { var error = 'Error getting synced wallet'; dispatch({ diff --git a/src/redux/actions/user.js b/src/redux/actions/user.js index 80b3c6d..0cb18e7 100644 --- a/src/redux/actions/user.js +++ b/src/redux/actions/user.js @@ -45,7 +45,12 @@ export function doFetchInviteStatus() { }; } -export function doInstallNew(appVersion, os = null, firebaseToken = null) { +export function doInstallNew( + appVersion, + os = null, + firebaseToken = null, + callbackForUsersWhoAreSharingData +) { const payload = { app_version: appVersion }; if (firebaseToken) { payload.firebase_token = firebaseToken; @@ -59,12 +64,22 @@ export function doInstallNew(appVersion, os = null, firebaseToken = null) { payload.operating_system = os || version.os_system; payload.platform = version.platform; Lbryio.call('install', 'new', payload); + + if (callbackForUsersWhoAreSharingData) { + callbackForUsersWhoAreSharingData(status); + } }); }); } // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params? -export function doAuthenticate(appVersion, os = null, firebaseToken = null, shareUsageData = true) { +export function doAuthenticate( + appVersion, + os = null, + firebaseToken = null, + shareUsageData = true, + callbackForUsersWhoAreSharingData +) { return dispatch => { dispatch({ type: ACTIONS.AUTHENTICATION_STARTED, @@ -81,7 +96,7 @@ export function doAuthenticate(appVersion, os = null, firebaseToken = null, shar if (shareUsageData) { dispatch(doRewardList()); dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os, firebaseToken); + doInstallNew(appVersion, os, firebaseToken, callbackForUsersWhoAreSharingData); } }); })