loadNeedFromRouteParamIfExists after logout, so we can make sure that the post will def. be shown in the visitor view (due to the moved checkAccessToCurrentRoute call at the end of the promise chain
import won from "../won-es6.js";
import Immutable from "immutable";
import { actionTypes, actionCreators } from "./actions.js";
-import { fetchOwnedData } from "../won-message-utils.js";
+import {
+ fetchOwnedData,
+ loadNeedFromRouteParamIfExists,
+} from "../won-message-utils.js";
import {
registerAccount,
transferPrivateAccount,
@@ -229,11 +232,12 @@ export function accountLogout() {
.then(() => dispatch({ type: actionTypes.downgradeHttpSession }))
.then(() => dispatch({ type: actionTypes.account.reset }))
.then(() => won.clearStore())
- .then(() => checkAccessToCurrentRoute(dispatch, getState))
+ .then(() => loadNeedFromRouteParamIfExists(dispatch, getState))
.then(() => {
_logoutInProcess = false;
})
- .then(() => dispatch({ type: actionTypes.account.logoutFinished }));
+ .then(() => dispatch({ type: actionTypes.account.logoutFinished }))
+ .then(() => checkAccessToCurrentRoute(dispatch, getState));
};
}
