1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-25 00:18:07 +00:00

add "unloading" flag to WalletReducer

This commit is contained in:
Szymon Lesisz 2018-09-20 18:24:08 +02:00
parent d918f4b45a
commit c5b6a40eff

View File

@ -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,