From c10b8baeba794c449873bd92cd8a1834bf1eebd2 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Tue, 9 Oct 2018 14:31:10 +0200 Subject: [PATCH] remove unused action WALLET.ON_BEFORE_UNLOAD --- src/actions/WalletActions.js | 6 ------ src/reducers/WalletReducer.js | 8 -------- src/services/RouterService.js | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/actions/WalletActions.js b/src/actions/WalletActions.js index b477ce14..0cd065d3 100644 --- a/src/actions/WalletActions.js +++ b/src/actions/WalletActions.js @@ -26,8 +26,6 @@ export type WalletAction = { } | { type: typeof WALLET.TOGGLE_DEVICE_DROPDOWN, opened: boolean -} | { - type: typeof WALLET.ON_BEFORE_UNLOAD } | { type: typeof WALLET.ONLINE_STATUS, online: boolean @@ -53,10 +51,6 @@ export const init = (): ThunkAction => (dispatch: Dispatch): void => { window.addEventListener('offline', updateOnlineStatus); }; -export const onBeforeUnload = (): WalletAction => ({ - type: WALLET.ON_BEFORE_UNLOAD, -}); - export const toggleDeviceDropdown = (opened: boolean): WalletAction => ({ type: WALLET.TOGGLE_DEVICE_DROPDOWN, opened, diff --git a/src/reducers/WalletReducer.js b/src/reducers/WalletReducer.js index bdcd0d15..4e13807f 100644 --- a/src/reducers/WalletReducer.js +++ b/src/reducers/WalletReducer.js @@ -12,7 +12,6 @@ import type { Action, RouterLocationState, TrezorDevice } from 'flowtype'; type State = { ready: boolean; - unloading: boolean; online: boolean; dropdownOpened: boolean; initialParams: ?RouterLocationState; @@ -23,7 +22,6 @@ type State = { const initialState: State = { ready: false, - unloading: false, online: navigator.onLine, dropdownOpened: false, initialParams: null, @@ -34,12 +32,6 @@ 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, diff --git a/src/services/RouterService.js b/src/services/RouterService.js index fac7c2b8..202165af 100644 --- a/src/services/RouterService.js +++ b/src/services/RouterService.js @@ -16,7 +16,7 @@ import type { const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispatch) => (action: Action): Action => { // make sure that middleware should process this action - if (action.type !== LOCATION_CHANGE || api.getState().wallet.unloading) { + if (action.type !== LOCATION_CHANGE) { // pass action return next(action); }