From d1bb7a9c2a72e9008d5c88e9302db2fe33298b76 Mon Sep 17 00:00:00 2001 From: liamcardenas Date: Mon, 26 Mar 2018 01:12:02 -0700 Subject: [PATCH] Authenticate as early as possible --- src/renderer/index.js | 4 +++- src/renderer/redux/actions/app.js | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index b81edfd2c..631e42af1 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -15,7 +15,7 @@ import { } from 'redux/actions/app'; import { doNavigate } from 'redux/actions/navigation'; import { doDownloadLanguages, doUpdateIsNightAsync } from 'redux/actions/settings'; -import { doUserEmailVerify } from 'redux/actions/user'; +import { doUserEmailVerify, doAuthenticate } from 'redux/actions/user'; import 'scss/all.scss'; import store from 'store'; import app from './app'; @@ -95,6 +95,8 @@ document.addEventListener('click', event => { }); const init = () => { + app.store.dispatch(doAuthenticate()); + autoUpdater.on('update-downloaded', () => { app.store.dispatch(doAutoUpdate()); }); diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index f9c868baf..fa1483c8f 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -9,7 +9,6 @@ import { doFetchRewardedContent } from 'redux/actions/content'; import { doFetchFileInfosAndPublishedClaims } from 'redux/actions/file_info'; import { doAuthNavigate } from 'redux/actions/navigation'; import { doFetchDaemonSettings } from 'redux/actions/settings'; -import { doAuthenticate } from 'redux/actions/user'; import { doBalanceSubscribe } from 'redux/actions/wallet'; import { doPause } from 'redux/actions/media'; import { doCheckSubscriptions } from 'redux/actions/subscriptions'; @@ -289,7 +288,6 @@ export function doDaemonReady() { return (dispatch, getState) => { const state = getState(); - dispatch(doAuthenticate()); dispatch({ type: ACTIONS.DAEMON_READY }); dispatch(doFetchDaemonSettings()); dispatch(doBalanceSubscribe());