summaryrefslogtreecommitdiffstats
path: root/web/react/stores
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-12-14 15:21:22 -0800
committer=Corey Hulen <corey@hulen.com>2015-12-14 15:21:22 -0800
commitb94d025da44aeebd9651f46cfc4fe367cdd56a87 (patch)
treec1a140d81eca5d9514a047db540adda0a6b45b11 /web/react/stores
parentf5ec973cba4c224de5ba75b56aad447f715b9d6b (diff)
downloadchat-b94d025da44aeebd9651f46cfc4fe367cdd56a87.tar.gz
chat-b94d025da44aeebd9651f46cfc4fe367cdd56a87.tar.bz2
chat-b94d025da44aeebd9651f46cfc4fe367cdd56a87.zip
PLT-1404 signal login to other tags
Diffstat (limited to 'web/react/stores')
-rw-r--r--web/react/stores/browser_store.jsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/react/stores/browser_store.jsx b/web/react/stores/browser_store.jsx
index ff6ae45ea..3417faaaf 100644
--- a/web/react/stores/browser_store.jsx
+++ b/web/react/stores/browser_store.jsx
@@ -29,6 +29,8 @@ class BrowserStoreClass {
this.checkedLocalStorageSupported = '';
this.signalLogout = this.signalLogout.bind(this);
this.isSignallingLogout = this.isSignallingLogout.bind(this);
+ this.signalLogin = this.signalLogin.bind(this);
+ this.isSignallingLogin = this.isSignallingLogin.bind(this);
var currentVersion = sessionStorage.getItem('storage_version');
if (currentVersion !== global.window.mm_config.Version) {
@@ -129,6 +131,21 @@ class BrowserStoreClass {
return logoutId === sessionStorage.getItem('__logout__');
}
+ signalLogin() {
+ if (this.isLocalStorageSupported()) {
+ // PLT-1285 store an identifier in session storage so we can catch if the logout came from this tab on IE11
+ const loginId = generateId();
+
+ sessionStorage.setItem('__login__', loginId);
+ localStorage.setItem('__login__', loginId);
+ localStorage.removeItem('__login__');
+ }
+ }
+
+ isSignallingLogin(loginId) {
+ return loginId === sessionStorage.getItem('__login__');
+ }
+
/**
* Preforms the given action on each item that has the given prefix
* Signature for action is action(key, value)