From: Ruben Beltran del Rio Date: Sun, 29 Aug 2021 20:21:27 +0000 (+0200) Subject: Use localStorage instead of sessionStorage X-Git-Url: https://git.r.bdr.sh/rbdr/prompt/commitdiff_plain/a4c6e02bd78b416f2ba18880d0b7cb3ed017393b?ds=sidebyside Use localStorage instead of sessionStorage --- diff --git a/src/lib/stores/prompt.js b/src/lib/stores/prompt.js index 7559657..d0dc629 100644 --- a/src/lib/stores/prompt.js +++ b/src/lib/stores/prompt.js @@ -11,14 +11,14 @@ const internals = { const shortLocale = locale.split('-')[0]; const targetFile = internals.kHost + internals.kDataPrefix + shortLocale + path; - const data = browser && sessionStorage.getItem(targetFile); + const data = browser && localStorage.getItem(targetFile); if (data) { return JSON.parse(data); } let newData = await (await fetch(targetFile)).json(); - browser && sessionStorage.setItem(targetFile, JSON.stringify(newData)); + browser && localStorage.setItem(targetFile, JSON.stringify(newData)); return newData; },