From c5b6a40effc16ef8628d3431b8bfea504deaa589 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Thu, 20 Sep 2018 18:24:08 +0200 Subject: [PATCH] add "unloading" flag to WalletReducer --- src/reducers/WalletReducer.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/reducers/WalletReducer.js b/src/reducers/WalletReducer.js index 5eb5698c..f6715e91 100644 --- a/src/reducers/WalletReducer.js +++ b/src/reducers/WalletReducer.js @@ -12,17 +12,18 @@ import type { Action, RouterLocationState, TrezorDevice } from 'flowtype'; type State = { ready: boolean; + unloading: boolean; online: boolean; dropdownOpened: boolean; initialParams: ?RouterLocationState; initialPathname: ?string; disconnectRequest: ?TrezorDevice; - selectedDevice: ?TrezorDevice; } const initialState: State = { ready: false, + unloading: false, online: navigator.onLine, dropdownOpened: false, initialParams: null, @@ -33,6 +34,12 @@ const initialState: State = { export default function wallet(state: State = initialState, action: Action): State { switch (action.type) { + case WALLET.ON_BEFORE_UNLOAD: + return { + ...state, + unloading: true + } + case WALLET.SET_INITIAL_URL: return { ...state,