From ffd762f08fe30859a83d64e52230dc5f74ea6ca1 Mon Sep 17 00:00:00 2001 From: liquidev Date: Tue, 29 Aug 2023 14:28:18 +0200 Subject: [PATCH] store persistent data in sessionStorage instead of localStorage closes #17 --- static/js/tree.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/tree.js b/static/js/tree.js index 1afad4a..ac6be15 100644 --- a/static/js/tree.js +++ b/static/js/tree.js @@ -3,11 +3,11 @@ import { navigationMap } from "/navmap.js"; const branchStateKey = "treehouse.openBranches"; -let branchState = JSON.parse(localStorage.getItem(branchStateKey)) || {}; +let branchState = JSON.parse(sessionStorage.getItem(branchStateKey)) || {}; function saveBranchIsOpen(branchID, state) { branchState[branchID] = state; - localStorage.setItem(branchStateKey, JSON.stringify(branchState)); + sessionStorage.setItem(branchStateKey, JSON.stringify(branchState)); } function branchIsOpen(branchID) {