From c695c09ecc6d2cae191c388c9f4d042de382e8d7 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 7 Nov 2023 14:53:36 +0000 Subject: [PATCH] Persist document in sessionStorage for fast reloads and offline use. --- cista-front/src/stores/documents.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cista-front/src/stores/documents.ts b/cista-front/src/stores/documents.ts index f7485e9..8ffb097 100644 --- a/cista-front/src/stores/documents.ts +++ b/cista-front/src/stores/documents.ts @@ -24,7 +24,6 @@ type User = { export const useDocumentStore = defineStore({ id: 'documents', state: () => ({ - root: {} as DirEntry, document: [] as Document[], search: "" as string, selected: new Set(), @@ -40,7 +39,10 @@ export const useDocumentStore = defineStore({ isOpenLoginModal: false } as User }), - + persist: { + storage: sessionStorage, + paths: ['document'], + }, actions: { updateRoot(root: DirEntry | null = null) { if (!root) {