diff --git a/client/src/actions/session-actions.js b/client/src/actions/session-actions.js index 90896f28..42ce50db 100644 --- a/client/src/actions/session-actions.js +++ b/client/src/actions/session-actions.js @@ -2,6 +2,7 @@ import _ from 'lodash'; import API from 'lib-app/api-call'; import AdminDataActions from 'actions/admin-data-actions'; +import ConfigActions from 'actions/config-actions'; import sessionStore from 'lib-app/session-store'; import store from 'app/store'; @@ -16,11 +17,13 @@ export default { path: '/user/login', data: _.extend(loginData, {remember: loginData.remember * 1}) }).then((result) => { - store.dispatch(this.getUserData(result.data.userId, result.data.token, result.data.staff)).then(() => { - if(result.data.staff) { - store.dispatch(AdminDataActions.retrieveCustomResponses()); - } - }); + store.dispatch(this.getUserData(result.data.userId, result.data.token, result.data.staff)) + .then(() => store.dispatch(ConfigActions.updateData())) + .then(() => { + if(result.data.staff) { + store.dispatch(AdminDataActions.retrieveCustomResponses()); + } + }); resolve(result); }).catch((result) => { diff --git a/client/src/app/main/dashboard/dashboard-menu.js b/client/src/app/main/dashboard/dashboard-menu.js index 27f13466..5e25d682 100644 --- a/client/src/app/main/dashboard/dashboard-menu.js +++ b/client/src/app/main/dashboard/dashboard-menu.js @@ -1,7 +1,7 @@ import React from 'react'; import _ from 'lodash'; -import {dispatch} from 'app/store'; +import store from 'app/store'; import SessionActions from 'actions/session-actions'; import i18n from 'lib-app/i18n'; @@ -65,7 +65,7 @@ class DashboardMenu extends React.Component { if (itemIndex < this.getDashboardRoutes().length) { this.goToPathByIndex(itemIndex) } else { - dispatch(SessionActions.logout()); + store.dispatch(SessionActions.logout()); } }