Fixed IE11 tabs preventing themselves from logging out

Этот коммит содержится в:
hmhealey
2015-12-03 15:00:20 -05:00
родитель ffd5d55465
Коммит 0ec5db65a7
2 изменённых файлов: 27 добавлений и 2 удалений

Просмотреть файл

@@ -57,7 +57,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;
}