From 015e6fc26258c54d9e26d4b1052b11515493e903 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 24 Jan 2017 18:17:23 +0100 Subject: [PATCH] Make sure we have the same hash in all the tabs when disconnecting --- www/common/cryptpad-common.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 9ae31a238..0de076e17 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -80,7 +80,7 @@ define([ var logout = common.logout = function (cb) { [ - fileHashKey, +// fileHashKey, userHashKey, ].forEach(function (k) { sessionStorage.removeItem(k); @@ -88,6 +88,11 @@ define([ delete localStorage[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(); } };