summaryrefslogtreecommitdiffstats
path: root/web/templates/head.html
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-12-15 08:58:51 -0500
committerJoram Wilander <jwawilander@gmail.com>2015-12-15 08:58:51 -0500
commit385046946296b26555af373bbfc5f6ea96593cd2 (patch)
tree3607477167b8f4746a1df8c557e137fd6f329c5a /web/templates/head.html
parentf6ca77b5d104e892ba6dc1a53a93c2ea2c49af73 (diff)
parentb94d025da44aeebd9651f46cfc4fe367cdd56a87 (diff)
downloadchat-385046946296b26555af373bbfc5f6ea96593cd2.tar.gz
chat-385046946296b26555af373bbfc5f6ea96593cd2.tar.bz2
chat-385046946296b26555af373bbfc5f6ea96593cd2.zip
Merge pull request #1730 from mattermost/PLT-1404
PLT-1404 signal login to other tabs
Diffstat (limited to 'web/templates/head.html')
-rw-r--r--web/templates/head.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/web/templates/head.html b/web/templates/head.html
index 7ffeeec7b..e80f0a24c 100644
--- a/web/templates/head.html
+++ b/web/templates/head.html
@@ -68,6 +68,16 @@
console.log('detected logout from a different tab');
window.location.href = '/' + window.mm_team.name;
}
+
+ if (e.originalEvent.key === '__login__' && e.originalEvent.storageArea === localStorage && e.originalEvent.newValue) {
+ // make sure it isn't this tab that is sending the logout signal (only necessary for IE11)
+ if (window.BrowserStore.isSignallingLogin(e.originalEvent.newValue)) {
+ return;
+ }
+
+ console.log('detected login from a different tab');
+ window.location.href = '/';
+ }
});
});
</script>