exclude landing page url fix

pull/500/head
Szymon Lesisz 5 years ago
parent 585c79a738
commit a797a52931

@ -434,7 +434,6 @@ export const setInitialUrl = (): PayloadAction<boolean> => (
// DEVICE.CONNECT race condition, "selectDevice" method was called but currently selectedDevice is in getState (auth) process // DEVICE.CONNECT race condition, "selectDevice" method was called but currently selectedDevice is in getState (auth) process
// if so, consume this action (return true) to break "selectDevice" process // if so, consume this action (return true) to break "selectDevice" process
// "setInitialUrl" will be called again after AUTH_DEVICE action
const { selectedDevice } = getState().wallet; const { selectedDevice } = getState().wallet;
if ( if (
selectedDevice && selectedDevice &&

@ -32,13 +32,12 @@ const WalletService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
// exclude landing page url // exclude landing page url
const { pathname } = action.payload.location; const { pathname } = action.payload.location;
const isValidPath = !api.dispatch(RouterActions.isLandingPageUrl(pathname, true)); const isValidPath = !api.dispatch(RouterActions.isLandingPageUrl(pathname, true));
if (isValidPath) { api.dispatch({
api.dispatch({ type: WALLET.SET_INITIAL_URL,
type: WALLET.SET_INITIAL_URL, pathname: isValidPath ? pathname : null,
pathname: action.payload.location.pathname, state: {},
state: {}, });
});
}
// pass action and break process // pass action and break process
return next(action); return next(action);
} }
@ -48,7 +47,7 @@ const WalletService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
switch (action.type) { switch (action.type) {
case WALLET.SET_INITIAL_URL: case WALLET.SET_INITIAL_URL:
if (action.pathname) { if (action.hasOwnProperty('pathname')) {
api.dispatch(LocalStorageActions.loadData()); api.dispatch(LocalStorageActions.loadData());
} }
break; break;

Loading…
Cancel
Save