mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-03 21:00:55 +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 => {
|
export const paramsValidation = (params: RouterLocationState): PayloadAction<boolean> => (dispatch: Dispatch, getState: GetState): boolean => {
|
||||||
// validate requested device
|
// validate requested device
|
||||||
|
|
||||||
|
console.log('params', params);
|
||||||
if (params.hasOwnProperty('device')) {
|
if (params.hasOwnProperty('device')) {
|
||||||
const { devices } = getState();
|
const { devices } = getState();
|
||||||
|
|
||||||
|
@ -25,7 +25,8 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
|
|||||||
const validUrl = api.dispatch(RouterActions.getValidUrl(action));
|
const validUrl = api.dispatch(RouterActions.getValidUrl(action));
|
||||||
// override action state (to be stored in RouterReducer)
|
// override action state (to be stored in RouterReducer)
|
||||||
const override = action;
|
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;
|
const redirect = action.payload.location.pathname !== validUrl;
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
// override action pathname
|
// override action pathname
|
||||||
|
@ -96,6 +96,7 @@ const Wallet = (props: WalletContainerProps) => (
|
|||||||
<ContextNotifications />
|
<ContextNotifications />
|
||||||
<Log />
|
<Log />
|
||||||
<Body>
|
<Body>
|
||||||
|
{JSON.stringify(props.wallet)}
|
||||||
{ props.children }
|
{ props.children }
|
||||||
</Body>
|
</Body>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
Loading…
Reference in New Issue
Block a user