mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-13 20:08:56 +00:00
Fix state propagation
This commit is contained in:
parent
786303400c
commit
5a6ea6610e
@ -51,6 +51,8 @@ export const pathToParams = (path: string): PayloadAction<RouterLocationState> =
|
||||
*/
|
||||
export const paramsValidation = (params: RouterLocationState): PayloadAction<boolean> => (dispatch: Dispatch, getState: GetState): boolean => {
|
||||
// validate requested device
|
||||
|
||||
console.log('params', params);
|
||||
if (params.hasOwnProperty('device')) {
|
||||
const { devices } = getState();
|
||||
|
||||
|
@ -25,7 +25,8 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
|
||||
const validUrl = api.dispatch(RouterActions.getValidUrl(action));
|
||||
// override action state (to be stored in RouterReducer)
|
||||
const override = action;
|
||||
override.payload.state = api.dispatch(RouterActions.pathToParams(validUrl));
|
||||
console.log('api.dispatch(RouterActions.pathToParams(validUrl))', api.dispatch(RouterActions.pathToParams(validUrl)));
|
||||
override.payload.location.state = api.dispatch(RouterActions.pathToParams(validUrl));
|
||||
const redirect = action.payload.location.pathname !== validUrl;
|
||||
if (redirect) {
|
||||
// override action pathname
|
||||
|
@ -96,6 +96,7 @@ const Wallet = (props: WalletContainerProps) => (
|
||||
<ContextNotifications />
|
||||
<Log />
|
||||
<Body>
|
||||
{JSON.stringify(props.wallet)}
|
||||
{ props.children }
|
||||
</Body>
|
||||
<Footer />
|
||||
|
Loading…
Reference in New Issue
Block a user