mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-05 21:00:58 +00:00
Fixed loop redirect
This commit is contained in:
parent
613302fb23
commit
0802d7d654
@ -85,7 +85,7 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
|
||||
__unloading = true;
|
||||
} else if (action.type === LOCATION_CHANGE && !__unloading) {
|
||||
const { location } = api.getState().router;
|
||||
const web3 = api.getState().web3;
|
||||
const { web3 } = api.getState();
|
||||
const { devices } = api.getState();
|
||||
const { error } = api.getState().connect;
|
||||
|
||||
@ -123,9 +123,8 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
|
||||
// PATH VALIDATION
|
||||
// redirect from root view
|
||||
if (action.payload.pathname === '/' || !validation(api, requestedParams)) {
|
||||
// TODO: switch to first device?
|
||||
// redirectPath = `/device/${ devices[0].path }`;
|
||||
redirectPath = location.pathname;
|
||||
// TODO redirect to first device
|
||||
redirectPath = '/device/x';
|
||||
} else if (requestedParams.device) {
|
||||
if (requestedParams.network !== currentParams.network) {
|
||||
postActions.push({
|
||||
@ -146,7 +145,7 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
|
||||
action.payload.state = pathToParams(url);
|
||||
action.payload.pathname = url;
|
||||
// change url
|
||||
api.dispatch(replace(url));
|
||||
// api.dispatch(replace(url));
|
||||
} else {
|
||||
action.payload.state = requestedParams;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user