From 8fa28fd0fab22d62e65ad42cf219ae19669337a0 Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Tue, 28 Nov 2023 13:36:08 +0100 Subject: [PATCH 01/11] Remove stray empty files --- foobar | 0 walrus | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 foobar delete mode 100644 walrus diff --git a/foobar b/foobar deleted file mode 100644 index e69de29..0000000 diff --git a/walrus b/walrus deleted file mode 100644 index e69de29..0000000 From 2d3ad1c7192abbe200b749468d1222094b5a247b Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Tue, 2 Jan 2024 14:57:00 +0100 Subject: [PATCH 02/11] Add tag to local storage key to indicate shape --- CHANGELOG.md | 4 ++++ src/store/corpus.store.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78f1b3f..2f697ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ As this project is a user-facing application, the places in the semantic version ## [Unreleased] +### Changed + +- The local storage key is now tagged with a datestamp, and should be changed when the data shape of the state changes + ## [1.0.5] (2023-11-28) ### Changed diff --git a/src/store/corpus.store.js b/src/store/corpus.store.js index 80f6ffe..151b63f 100644 --- a/src/store/corpus.store.js +++ b/src/store/corpus.store.js @@ -4,7 +4,11 @@ import { useStorage } from "@vueuse/core"; import { setKeys } from "@/util"; export const useCorpusStore = defineStore("corpus", () => { - const corporaRef = useStorage("corpora", {}); + // Connect state to browser's local storage. Change the number here to the + // current date (YYMMDD) if the state shape is changed, to make the browser + // forget the old state. The actual number doesn't really matter, as long as + // it's a new one. + const corporaRef = useStorage("mink@230102.corpora", {}); const corpora = reactive(corporaRef.value); function setCorpusIds(corpusIds) { From 315b10723a5926f17bd40c08a4bbc6b5a53eb0b2 Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Tue, 2 Jan 2024 14:57:19 +0100 Subject: [PATCH 03/11] Use computed in PendingContent --- src/spin/PendingContent.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/spin/PendingContent.vue b/src/spin/PendingContent.vue index adca9bf..379279b 100644 --- a/src/spin/PendingContent.vue +++ b/src/spin/PendingContent.vue @@ -1,21 +1,23 @@