mirror of
https://github.com/trezor/trezor-wallet
synced 2025-03-19 09:36:07 +00:00
exclude landing page url fix
This commit is contained in:
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…
Reference in New Issue
Block a user