From e7a652851ed2bbdfeede371ce3eb3b8479e4f272 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 14 Jan 2020 07:04:42 +0000 Subject: [PATCH] Use only the first part of the path for the local storage --- view/js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index fed9cc59f..81d26120e 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -40,7 +40,7 @@ function initWidget(inflated, deflated) { if (!elInf || !elDef) { return; } - if (localStorage.getItem(window.location.pathname + ":" + inflated) != "none") { + if (localStorage.getItem(window.location.pathname.split("/")[1] + ":" + inflated) != "none") { elInf.style.display = "block"; elDef.style.display = "none"; } else { @@ -60,11 +60,11 @@ function openCloseWidget(inflated, deflated) { if (window.getComputedStyle(elInf).display === "none") { elInf.style.display = "block"; elDef.style.display = "none"; - localStorage.setItem(window.location.pathname + ":" + inflated, "block"); + localStorage.setItem(window.location.pathname.split("/")[1] + ":" + inflated, "block"); } else { elInf.style.display = "none"; elDef.style.display = "block"; - localStorage.setItem(window.location.pathname + ":" + inflated, "none"); + localStorage.setItem(window.location.pathname.split("/")[1] + ":" + inflated, "none"); } }