From 786303400ced5d5459ce4eafae2822142c5e2682 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 18 Dec 2018 18:12:49 +0100 Subject: [PATCH] Update fields according to new react-router --- src/reducers/WalletReducer.js | 1 + src/services/RouterService.js | 4 ++-- src/services/WalletService.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/reducers/WalletReducer.js b/src/reducers/WalletReducer.js index edcf674d..9a76caad 100644 --- a/src/reducers/WalletReducer.js +++ b/src/reducers/WalletReducer.js @@ -36,6 +36,7 @@ const initialState: State = { export default function wallet(state: State = initialState, action: Action): State { switch (action.type) { case WALLET.SET_INITIAL_URL: + console.log('action2', action); return { ...state, initialParams: action.state, diff --git a/src/services/RouterService.js b/src/services/RouterService.js index a853ae86..5f5fe7d7 100644 --- a/src/services/RouterService.js +++ b/src/services/RouterService.js @@ -26,10 +26,10 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa // override action state (to be stored in RouterReducer) const override = action; override.payload.state = api.dispatch(RouterActions.pathToParams(validUrl)); - const redirect = action.payload.pathname !== validUrl; + const redirect = action.payload.location.pathname !== validUrl; if (redirect) { // override action pathname - override.payload.pathname = validUrl; + override.payload.location.pathname = validUrl; } // pass action diff --git a/src/services/WalletService.js b/src/services/WalletService.js index 33239f28..95890b0c 100644 --- a/src/services/WalletService.js +++ b/src/services/WalletService.js @@ -34,7 +34,7 @@ const WalletService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa // TODO: validate if initial url is potentially correct api.dispatch({ type: WALLET.SET_INITIAL_URL, - pathname: action.payload.pathname, + pathname: action.payload.location.pathname, state: {}, }); // pass action and break process