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
// if so, consume this action (return true) to break "selectDevice" process
// "setInitialUrl" will be called again after AUTH_DEVICE action
const { selectedDevice } = getState().wallet;
if (
selectedDevice &&

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

Loading…
Cancel
Save