diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-11 21:51:54 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-10-17 17:54:13 +0200 |
commit | 7b78a64fa877074cf44dda59c6c11e99ea194722 (patch) | |
tree | f11564a666dd6ba9093509ae9fd592b013711780 /apps/files/src/store/files.ts | |
parent | c7d22f9773e52a26253bc7b00b547b40e819bb97 (diff) | |
download | nextcloud-server-backport/47905/stable30.tar.gz nextcloud-server-backport/47905/stable30.zip |
test(files): Add tests for path handlingbackport/47905/stable30
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src/store/files.ts')
-rw-r--r-- | apps/files/src/store/files.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files/src/store/files.ts b/apps/files/src/store/files.ts index 1af675e67ce..5a701f52b3c 100644 --- a/apps/files/src/store/files.ts +++ b/apps/files/src/store/files.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import type { FilesStore, RootsStore, RootOptions, Service, FilesState, FileSource } from '../types' +import type { FilesStore, RootsStore, RootOptions, Service, FileSource } from '../types' import type { FileStat, ResponseDataDetailed } from 'webdav' import type { Folder, Node } from '@nextcloud/files' @@ -27,9 +27,10 @@ const fetchNode = async (node: Node): Promise<Node> => { export const useFilesStore = function(...args) { const store = defineStore('files', { - state: (): FilesState => ({ + state: () => ({ files: {} as FilesStore, roots: {} as RootsStore, + _initialized: false, }), getters: { @@ -86,6 +87,7 @@ export const useFilesStore = function(...args) { } // If we found a cache entry and the cache entry was already loaded (has children) then use it + // @ts-expect-error The _children prop is undocumented - we need to make this official return (folder?._children ?? []) .map((source: string) => this.getNode(source)) .filter(Boolean) |