summaryrefslogtreecommitdiffstats
path: root/web/templates/head.html
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-12-04 08:21:01 -0500
committerJoram Wilander <jwawilander@gmail.com>2015-12-04 08:21:01 -0500
commit93db32da7b97f4d4c10afc17f48c2221eefb54c7 (patch)
treea9ee2c3b326b43e1cc86bd41ebd0581a1d7a75f7 /web/templates/head.html
parent84f2afe52d76e5d8ea01e9bb882275db2539751a (diff)
parent0ec5db65a7d356d1df617d096d5dc1dd2e76fb0e (diff)
downloadchat-93db32da7b97f4d4c10afc17f48c2221eefb54c7.tar.gz
chat-93db32da7b97f4d4c10afc17f48c2221eefb54c7.tar.bz2
chat-93db32da7b97f4d4c10afc17f48c2221eefb54c7.zip
Merge pull request #1604 from hmhealey/plt1285
PLT-1285 Fixed IE11 tabs preventing themselves from logging out
Diffstat (limited to 'web/templates/head.html')
-rw-r--r--web/templates/head.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/web/templates/head.html b/web/templates/head.html
index 709edbaec..be4ed2b25 100644
--- a/web/templates/head.html
+++ b/web/templates/head.html
@@ -58,7 +58,13 @@
$(function () {
$(window).bind('storage', function (e) {
- if (e.originalEvent.key === '__logout__') {
+ // when one tab on a browser logs out, it sets __logout__ in localStorage to trigger other tabs to log out
+ if (e.originalEvent.key === '__logout__' && 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.isSignallingLogout(e.originalEvent.newValue)) {
+ return;
+ }
+
console.log('detected logout from a different tab');
window.location.href = '/' + window.mm_team.name;
}