Persist document in sessionStorage for fast reloads and offline use.
This commit is contained in:
parent
d36605cd5b
commit
c695c09ecc
|
@ -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<FUID>(),
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user