From 1e605421a19fe89119dedfe6e9e77280d1d92949 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Mon, 20 Aug 2018 14:07:58 +0200 Subject: [PATCH] fix(ux): show loading bolt while seed is generated Ensure that the loading bold graphic shows whist the seed for a new wallet is being generated. This provides a smoother user experience and prevents users from being able to initiate actions through the UI when they shouldn't be able to. --- app/reducers/onboarding.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/reducers/onboarding.js b/app/reducers/onboarding.js index 7bd4e754..820a1118 100644 --- a/app/reducers/onboarding.js +++ b/app/reducers/onboarding.js @@ -268,6 +268,7 @@ export const startLndError = (event, errors) => (dispatch, getState) => { export const walletUnlockerGrpcActive = () => dispatch => { dispatch({ type: LND_STARTED }) ipcRenderer.send('walletUnlocker', { msg: 'genSeed' }) + dispatch({ type: FETCH_SEED }) } export const createWallet = () => dispatch => { @@ -342,7 +343,8 @@ const ACTION_HANDLERS = { [SET_AUTOPILOT]: (state, { autopilot }) => ({ ...state, autopilot }), - [SET_HAS_SEED]: (state, { hasSeed }) => ({ ...state, hasSeed }), + [FETCH_SEED]: state => ({ ...state, fetchingSeed: true }), + [SET_HAS_SEED]: (state, { hasSeed }) => ({ ...state, hasSeed, fetchingSeed: false }), [SET_SEED]: (state, { seed }) => ({ ...state, seed, fetchingSeed: false }), [SET_RE_ENTER_SEED_INDEXES]: (state, { seedIndexesArr }) => ({ ...state, seedIndexesArr }),