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) {
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) {
payload.app_id = status.installation_id;
payload.node_id = status.lbry_id;
_lbryRedux.Lbry.version().then(function (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;
_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) {
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) {
dispatch({
@ -8465,7 +8465,7 @@ function doAuthenticate(appVersion) {
});
dispatch((0, _rewards.doRewardList)());
dispatch(doFetchInviteStatus());
doInstallNew(appVersion, deviceId);
doInstallNew(appVersion, os_system);
}).catch(function (error) {
dispatch((0, _lbryRedux.doNotify)({ id: _lbryRedux.MODALS.AUTHENTICATION_FAILURE }));
dispatch({

View file

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