From c6bdb7506d8c1e3c10cb75ecbee2f0a7b28b7ae8 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 22 Jul 2016 15:18:09 +0200 Subject: [PATCH] forget everything about a pad when you forget it --- www/common/cryptpad-common.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 7ca0b6236..0a6c6f4f0 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -116,6 +116,14 @@ define([ return pad.href !== href; }); setRecentPads(recentPads); + + var hash; + href.replace(/#(.*)$/, function (h) { hash = h; }); + if (!hash) { return; } + Object.keys(localStorage).forEach(function (k) { + if (k.indexOf(hash) === 0) { localStorage.removeItem(k); } + }); + }; var rememberPad = common.rememberPad = window.rememberPad = function (title) {