diff --git a/ui/redux/actions/app.js b/ui/redux/actions/app.js index 4d0033dc2a..1f1b8db395 100644 --- a/ui/redux/actions/app.js +++ b/ui/redux/actions/app.js @@ -283,17 +283,16 @@ export function doMinVersionCheck() { return (dispatch: Dispatch) => { fetch(`${URL}/$/minVersion/v1/get`) .then((response) => response.json()) - .then((json) => { - if (json?.status === 'success' && json?.data && MINIMUM_VERSION) { - const liveMinimumVersion = Number(json.data); - if (liveMinimumVersion > MINIMUM_VERSION) { - dispatch({ type: ACTIONS.RELOAD_REQUIRED, data: { reason: 'newVersionFound', extra: liveMinimumVersion } }); - } + .then((json) => (json?.status === 'success' && json?.data ? Number(json.data) : undefined)) + .then((liveMinimumVersion) => { + if (liveMinimumVersion > MINIMUM_VERSION) { + dispatch({ + type: ACTIONS.RELOAD_REQUIRED, + data: { reason: 'newVersionFound', extra: liveMinimumVersion }, + }); } }) - .catch((err) => { - assert(false, 'minVersion failed', err); - }); + .catch((err) => assert(false, 'minVersion failed', err)); }; } diff --git a/ui/redux/middleware/analytics.js b/ui/redux/middleware/analytics.js index 3f7d8a4886..c963ffa0f6 100644 --- a/ui/redux/middleware/analytics.js +++ b/ui/redux/middleware/analytics.js @@ -70,8 +70,8 @@ function handleAnalyticsForAction(action: { type: string, data: any }) { case ACTIONS.RELOAD_REQUIRED: { const { reason, extra } = action.data; - if (reason === 'newVersionAvailable') { - analytics.log('New version nag', { + if (reason === 'newVersionFound') { + analytics.log('Displayed new version nag', { level: 'info', fingerprint: [reason], tags: { reloadReason: reason, newVersion: extra },