1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 11:18:16 +00:00

Update fields according to new react-router

This commit is contained in:
Vladimir Volek 2018-12-18 18:12:49 +01:00 committed by Szymon Lesisz
parent 0f9d864347
commit 786303400c
3 changed files with 4 additions and 3 deletions

View File

@ -36,6 +36,7 @@ const initialState: State = {
export default function wallet(state: State = initialState, action: Action): State { export default function wallet(state: State = initialState, action: Action): State {
switch (action.type) { switch (action.type) {
case WALLET.SET_INITIAL_URL: case WALLET.SET_INITIAL_URL:
console.log('action2', action);
return { return {
...state, ...state,
initialParams: action.state, initialParams: action.state,

View File

@ -26,10 +26,10 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
// 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)); override.payload.state = api.dispatch(RouterActions.pathToParams(validUrl));
const redirect = action.payload.pathname !== validUrl; const redirect = action.payload.location.pathname !== validUrl;
if (redirect) { if (redirect) {
// override action pathname // override action pathname
override.payload.pathname = validUrl; override.payload.location.pathname = validUrl;
} }
// pass action // pass action

View File

@ -34,7 +34,7 @@ const WalletService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
// TODO: validate if initial url is potentially correct // TODO: validate if initial url is potentially correct
api.dispatch({ api.dispatch({
type: WALLET.SET_INITIAL_URL, type: WALLET.SET_INITIAL_URL,
pathname: action.payload.pathname, pathname: action.payload.location.pathname,
state: {}, state: {},
}); });
// pass action and break process // pass action and break process