From f5c06e070c85ca4d468c4b82e1d05e2a347a5e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 7 Oct 2015 09:31:38 +0200 Subject: [PATCH] Separate dispatcher logic of whitelabel and user stores --- js/actions/user_actions.js | 4 ++-- js/actions/whitelabel_actions.js | 4 ++-- js/alt.js | 2 ++ js/components/logout_container.js | 7 +++++-- js/stores/user_store.js | 4 ++-- js/stores/whitelabel_store.js | 4 ++-- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/js/actions/user_actions.js b/js/actions/user_actions.js index 9233244d..661890e9 100644 --- a/js/actions/user_actions.js +++ b/js/actions/user_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import { alt } from '../alt'; +import { altUser } from '../alt'; import UserFetcher from '../fetchers/user_fetcher'; @@ -34,4 +34,4 @@ class UserActions { } } -export default alt.createActions(UserActions); +export default altUser.createActions(UserActions); diff --git a/js/actions/whitelabel_actions.js b/js/actions/whitelabel_actions.js index 95d4fc27..a1460fb8 100644 --- a/js/actions/whitelabel_actions.js +++ b/js/actions/whitelabel_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import { alt } from '../alt'; +import { altWhitelabel } from '../alt'; import WhitelabelFetcher from '../fetchers/whitelabel_fetcher'; @@ -26,4 +26,4 @@ class WhitelabelActions { } } -export default alt.createActions(WhitelabelActions); +export default altWhitelabel.createActions(WhitelabelActions); diff --git a/js/alt.js b/js/alt.js index 5b0fa670..141248c1 100644 --- a/js/alt.js +++ b/js/alt.js @@ -4,3 +4,5 @@ import Alt from 'alt'; export let alt = new Alt(); export let altThirdParty = new Alt(); +export let altUser = new Alt(); +export let altWhitelabel = new Alt(); diff --git a/js/components/logout_container.js b/js/components/logout_container.js index 70a20034..74c16439 100644 --- a/js/components/logout_container.js +++ b/js/components/logout_container.js @@ -4,7 +4,7 @@ import React from 'react'; import Router from 'react-router'; import UserActions from '../actions/user_actions'; -import { alt } from '../alt'; +import { alt, altWhitelabel, altUser, altThirdParty } from '../alt'; import AppConstants from '../constants/application_constants'; let baseUrl = AppConstants.baseUrl; @@ -16,7 +16,10 @@ let LogoutContainer = React.createClass({ componentDidMount() { UserActions.logoutCurrentUser() .then(() => { - Alt.flush(); + alt.flush(); + altWhitelabel.flush(); + altUser.flush(); + altThirdParty.flush(); // kill intercom (with fire) window.Intercom('shutdown'); this.replaceWith(baseUrl); diff --git a/js/stores/user_store.js b/js/stores/user_store.js index da9eac93..8ea18eea 100644 --- a/js/stores/user_store.js +++ b/js/stores/user_store.js @@ -1,6 +1,6 @@ 'use strict'; -import { alt } from '../alt'; +import { altUser } from '../alt'; import UserActions from '../actions/user_actions'; @@ -18,4 +18,4 @@ class UserStore { } } -export default alt.createStore(UserStore, 'UserStore'); +export default altUser.createStore(UserStore, 'UserStore'); diff --git a/js/stores/whitelabel_store.js b/js/stores/whitelabel_store.js index 9db49d4e..017fb98e 100644 --- a/js/stores/whitelabel_store.js +++ b/js/stores/whitelabel_store.js @@ -1,6 +1,6 @@ 'use strict'; -import { alt } from '../alt'; +import { altWhitelabel } from '../alt'; import WhitelabelActions from '../actions/whitelabel_actions'; @@ -15,4 +15,4 @@ class WhitelabelStore { } } -export default alt.createStore(WhitelabelStore, 'WhitelabelStore'); +export default altWhitelabel.createStore(WhitelabelStore, 'WhitelabelStore');