Make sure we have the same hash in all the tabs when disconnecting

This commit is contained in:
yflory
2017-01-24 18:17:23 +01:00
parent ce1e792419
commit 015e6fc262

View File

@@ -80,7 +80,7 @@ define([
var logout = common.logout = function (cb) { var logout = common.logout = function (cb) {
[ [
fileHashKey, // fileHashKey,
userHashKey, userHashKey,
].forEach(function (k) { ].forEach(function (k) {
sessionStorage.removeItem(k); sessionStorage.removeItem(k);
@@ -88,6 +88,11 @@ define([
delete localStorage[k]; delete localStorage[k];
delete sessionStorage[k]; delete sessionStorage[k];
}); });
// Make sure we have an FS_hash in localStorage before reloading all the tabs
// so that we don't end up with tabs using different anon hashes
if (!localStorage[fileHashKey]) {
localStorage[fileHashKey] = common.createRandomHash();
}
if (cb) { cb(); } if (cb) { cb(); }
}; };