remove deviceId parameter and add an os parameter for os_system override

This commit is contained in:
Akinwale Ariwodola 2018-09-03 19:50:43 +01:00
parent 9132de92f6
commit f2fff2a331
2 changed files with 12 additions and 12 deletions

12
dist/bundle.js vendored
View file

@ -8434,24 +8434,24 @@ function doFetchInviteStatus() {
} }
function doInstallNew(appVersion) { function doInstallNew(appVersion) {
var deviceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var os_system = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var payload = { app_version: appVersion, device_id: deviceId }; var payload = { app_version: appVersion };
_lbryRedux.Lbry.status().then(function (status) { _lbryRedux.Lbry.status().then(function (status) {
payload.app_id = status.installation_id; payload.app_id = status.installation_id;
payload.node_id = status.lbry_id; payload.node_id = status.lbry_id;
_lbryRedux.Lbry.version().then(function (version) { _lbryRedux.Lbry.version().then(function (version) {
payload.daemon_version = version.lbrynet_version; payload.daemon_version = version.lbrynet_version;
payload.operating_system = version.os_system; payload.operating_system = os_system || version.os_system;
payload.platform = version.platform; payload.platform = version.platform;
_lbryio2.default.call('install', 'new', payload); _lbryio2.default.call('install', 'new', payload);
}); });
}); });
} }
// TODO: Call doInstallNew separately so we don't have to pass appVersion and deviceId params? // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params?
function doAuthenticate(appVersion) { function doAuthenticate(appVersion) {
var deviceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var os_system = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
return function (dispatch) { return function (dispatch) {
dispatch({ dispatch({
@ -8465,7 +8465,7 @@ function doAuthenticate(appVersion) {
}); });
dispatch((0, _rewards.doRewardList)()); dispatch((0, _rewards.doRewardList)());
dispatch(doFetchInviteStatus()); dispatch(doFetchInviteStatus());
doInstallNew(appVersion, deviceId); doInstallNew(appVersion, os_system);
}).catch(function (error) { }).catch(function (error) {
dispatch((0, _lbryRedux.doNotify)({ id: _lbryRedux.MODALS.AUTHENTICATION_FAILURE })); dispatch((0, _lbryRedux.doNotify)({ id: _lbryRedux.MODALS.AUTHENTICATION_FAILURE }));
dispatch({ dispatch({

View file

@ -33,22 +33,22 @@ export function doFetchInviteStatus() {
}; };
} }
export function doInstallNew(appVersion, deviceId = null) { export function doInstallNew(appVersion, os = null) {
const payload = { app_version: appVersion, device_id: deviceId }; const payload = { app_version: appVersion };
Lbry.status().then(status => { Lbry.status().then(status => {
payload.app_id = status.installation_id; payload.app_id = status.installation_id;
payload.node_id = status.lbry_id; payload.node_id = status.lbry_id;
Lbry.version().then(version => { Lbry.version().then(version => {
payload.daemon_version = version.lbrynet_version; payload.daemon_version = version.lbrynet_version;
payload.operating_system = version.os_system; payload.operating_system = os || version.os_system;
payload.platform = version.platform; payload.platform = version.platform;
Lbryio.call('install', 'new', payload); Lbryio.call('install', 'new', payload);
}); });
}); });
} }
// TODO: Call doInstallNew separately so we don't have to pass appVersion and deviceId params? // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params?
export function doAuthenticate(appVersion, deviceId = null) { export function doAuthenticate(appVersion, os = null) {
return dispatch => { return dispatch => {
dispatch({ dispatch({
type: ACTIONS.AUTHENTICATION_STARTED, type: ACTIONS.AUTHENTICATION_STARTED,
@ -62,7 +62,7 @@ export function doAuthenticate(appVersion, deviceId = null) {
}); });
dispatch(doRewardList()); dispatch(doRewardList());
dispatch(doFetchInviteStatus()); dispatch(doFetchInviteStatus());
doInstallNew(appVersion, deviceId); doInstallNew(appVersion, os);
}) })
.catch(error => { .catch(error => {
dispatch(doNotify({ id: MODALS.AUTHENTICATION_FAILURE })); dispatch(doNotify({ id: MODALS.AUTHENTICATION_FAILURE }));