remove unused action WALLET.ON_BEFORE_UNLOAD

pull/150/head
Szymon Lesisz 6 years ago
parent 7ed5f11021
commit c10b8baeba

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

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

@ -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);
}

Loading…
Cancel
Save