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:
parent
0f9d864347
commit
786303400c
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user