diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 57ab6e6..e34a885 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1161,10 +1161,15 @@ function doFetchInviteStatus() { }); }; } -function doInstallNew(appVersion, os = null) { +function doInstallNew(appVersion, os = null, firebaseToken = null) { const payload = { app_version: appVersion }; + + if (firebaseToken) { + payload.firebase_token = firebaseToken; + } + lbryRedux.Lbry.status().then(status => { payload.app_id = status.installation_id; payload.node_id = status.lbry_id; @@ -1177,7 +1182,7 @@ function doInstallNew(appVersion, os = null) { }); } // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params? -function doAuthenticate(appVersion, os = null) { +function doAuthenticate(appVersion, os = null, firebaseToken = null) { return dispatch => { dispatch({ type: AUTHENTICATION_STARTED @@ -1192,7 +1197,7 @@ function doAuthenticate(appVersion, os = null) { }); dispatch(doRewardList()); dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os); + doInstallNew(appVersion, os, firebaseToken); }).catch(error => { dispatch({ type: AUTHENTICATION_FAILURE, diff --git a/dist/bundle.js b/dist/bundle.js index d1c5bcc..71008f5 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -2631,9 +2631,15 @@ 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 payload = { app_version: appVersion }; + + if (firebaseToken) { + payload.firebase_token = firebaseToken; + } + lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].status().then(function (status) { payload.app_id = status.installation_id; payload.node_id = status.lbry_id; @@ -2648,6 +2654,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; return function (dispatch) { dispatch({ type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["AUTHENTICATION_STARTED"] @@ -2662,7 +2669,7 @@ function doAuthenticate(appVersion) { }); dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])()); dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os); + doInstallNew(appVersion, os, firebaseToken); })["catch"](function (error) { dispatch({ type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["AUTHENTICATION_FAILURE"], diff --git a/src/redux/actions/user.js b/src/redux/actions/user.js index 8905eeb..6b39c7b 100644 --- a/src/redux/actions/user.js +++ b/src/redux/actions/user.js @@ -37,8 +37,12 @@ export function doFetchInviteStatus() { }; } -export function doInstallNew(appVersion, os = null) { +export function doInstallNew(appVersion, os = null, firebaseToken = null) { const payload = { app_version: appVersion }; + if (firebaseToken) { + payload.firebase_token = firebaseToken; + } + Lbry.status().then(status => { payload.app_id = status.installation_id; payload.node_id = status.lbry_id; @@ -52,7 +56,7 @@ export function doInstallNew(appVersion, os = null) { } // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params? -export function doAuthenticate(appVersion, os = null) { +export function doAuthenticate(appVersion, os = null, firebaseToken = null) { return dispatch => { dispatch({ type: ACTIONS.AUTHENTICATION_STARTED, @@ -67,7 +71,7 @@ export function doAuthenticate(appVersion, os = null) { }); dispatch(doRewardList()); dispatch(doFetchInviteStatus()); - doInstallNew(appVersion, os); + doInstallNew(appVersion, os, firebaseToken); }) .catch(error => { dispatch({