1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +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 {
switch (action.type) {
case WALLET.SET_INITIAL_URL:
console.log('action2', action);
return {
...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)
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

View File

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