pass app version info to internal APIs
This commit is contained in:
parent
7e7b8d770b
commit
61bddf3ea3
1 changed files with 18 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
import * as ACTIONS from 'constants/action_types';
|
import * as ACTIONS from 'constants/action_types';
|
||||||
import Lbryio from 'lbryio';
|
import Lbryio from 'lbryio';
|
||||||
import { doNotify, MODALS } from 'lbry-redux';
|
import { Lbry, doNotify, MODALS } from 'lbry-redux';
|
||||||
import { doClaimRewardType, doRewardList } from 'redux/actions/rewards';
|
import { doClaimRewardType, doRewardList } from 'redux/actions/rewards';
|
||||||
import {
|
import {
|
||||||
selectEmailToVerify,
|
selectEmailToVerify,
|
||||||
|
@ -9,6 +9,7 @@ import {
|
||||||
} from 'redux/selectors/user';
|
} from 'redux/selectors/user';
|
||||||
import rewards from 'rewards';
|
import rewards from 'rewards';
|
||||||
import analytics from 'analytics';
|
import analytics from 'analytics';
|
||||||
|
import pjson from 'package.json';
|
||||||
|
|
||||||
export function doFetchInviteStatus() {
|
export function doFetchInviteStatus() {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
|
@ -35,6 +36,21 @@ export function doFetchInviteStatus() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function doInstallNew() {
|
||||||
|
return dispatch => {
|
||||||
|
const payload = {app_version: pjson.version};
|
||||||
|
Lbry.status().then(status => {
|
||||||
|
payload.app_id = status.installation_id;
|
||||||
|
Lbry.version().then(version => {
|
||||||
|
payload.daemon_version = version.lbrynet_version;
|
||||||
|
payload.platform = version.platform;
|
||||||
|
Lbryio.call('install', 'new', payload);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export function doAuthenticate() {
|
export function doAuthenticate() {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch({
|
dispatch({
|
||||||
|
@ -49,6 +65,7 @@ export function doAuthenticate() {
|
||||||
});
|
});
|
||||||
dispatch(doRewardList());
|
dispatch(doRewardList());
|
||||||
dispatch(doFetchInviteStatus());
|
dispatch(doFetchInviteStatus());
|
||||||
|
dispatch(doInstallNew());
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
dispatch(doNotify({ id: MODALS.AUTHENTICATION_FAILURE }));
|
dispatch(doNotify({ id: MODALS.AUTHENTICATION_FAILURE }));
|
||||||
|
|
Loading…
Add table
Reference in a new issue