Pass app version info to internal APIs #1583

Merged
daovist merged 3 commits from issue/1579 into master 2018-06-13 22:40:28 +02:00

View file

@ -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,19 @@ export function doFetchInviteStatus() {
}; };
} }
export function doInstallNew() {
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.operating_system = version.os_system;
payload.platform = version.platform;
Lbryio.call('install', 'new', payload);
});
});
}
export function doAuthenticate() { export function doAuthenticate() {
return dispatch => { return dispatch => {
dispatch({ dispatch({
@ -49,6 +63,7 @@ export function doAuthenticate() {
}); });
dispatch(doRewardList()); dispatch(doRewardList());
dispatch(doFetchInviteStatus()); dispatch(doFetchInviteStatus());
neb-b commented 2018-06-13 18:31:08 +02:00 (Migrated from github.com)
Review

Since we aren't storing this in the store, we don't need to wrap this call in a dispatch. You can just call doInstallNew() after.

Since we aren't storing this in the store, we don't need to wrap this call in a `dispatch`. You can just call `doInstallNew()` after.
doInstallNew();
}) })
.catch(error => { .catch(error => {
dispatch(doNotify({ id: MODALS.AUTHENTICATION_FAILURE })); dispatch(doNotify({ id: MODALS.AUTHENTICATION_FAILURE }));