diff --git a/src/js/components/wallet/account/AbstractAccount.js b/src/js/components/wallet/account/AbstractAccount.js index e008f111..f281bbc6 100644 --- a/src/js/components/wallet/account/AbstractAccount.js +++ b/src/js/components/wallet/account/AbstractAccount.js @@ -103,7 +103,7 @@ export default class AbstractAccount

extends ComponentDevice with state {accountState.deviceState} not found); + return (

); } // account not found. checking why... diff --git a/src/js/services/RouterService.js b/src/js/services/RouterService.js index 9d5bc22a..e8b41b7a 100644 --- a/src/js/services/RouterService.js +++ b/src/js/services/RouterService.js @@ -94,20 +94,19 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa const requestedParams: RouterLocationState = pathToParams(action.payload.pathname); const currentParams: RouterLocationState = pathToParams(location ? location.pathname : '/'); + const postActions: Array = []; let redirectPath: ?string; // first event after application loads if (!location) { - api.dispatch({ + postActions.push({ type: WALLET.SET_INITIAL_URL, pathname: action.payload.pathname, state: requestedParams }); redirectPath = '/'; - - //return next(action); } else { const isModalOpened: boolean = api.getState().modal.opened; @@ -132,7 +131,7 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa } else if (requestedParams.device) { if (currentParams.device !== requestedParams.device || currentParams.deviceInstance !== requestedParams.deviceInstance) { - api.dispatch({ + postActions.push({ type: CONNECT.SELECT_DEVICE, payload: { id: requestedParams.device, @@ -142,7 +141,7 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa } if (requestedParams.network !== currentParams.network) { - api.dispatch({ + postActions.push({ type: CONNECT.COIN_CHANGED, payload: { network: requestedParams.network @@ -165,7 +164,17 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa action.payload.state = requestedParams; } + // resolve LOCATION_CHANGE action + next(action); + + // resolve post actions + postActions.forEach(a => { + api.dispatch(a); + }); + api.dispatch( NotificationActions.clear(currentParams, requestedParams) ); + + return action; } // Pass all actions through by default