1
0
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:
Vladimir Volek 2018-12-20 15:20:02 +01:00 committed by Szymon Lesisz
parent 786303400c
commit 5a6ea6610e
3 changed files with 5 additions and 1 deletions

View File

@ -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();

View File

@ -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

View File

@ -96,6 +96,7 @@ const Wallet = (props: WalletContainerProps) => (
<ContextNotifications />
<Log />
<Body>
{JSON.stringify(props.wallet)}
{ props.children }
</Body>
<Footer />