From 7f76df44394cacab40fa145872149b16abac9849 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 16 Oct 2024 13:08:06 +0200 Subject: [PATCH] fix(files): Adjust Typescript issues Signed-off-by: Ferdinand Thiessen --- apps/files/src/eventbus.d.ts | 5 ++++- apps/files/src/store/files.ts | 3 ++- apps/files/src/store/paths.ts | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/files/src/eventbus.d.ts b/apps/files/src/eventbus.d.ts index 6a25e463a4d1a..42e2622cc32c3 100644 --- a/apps/files/src/eventbus.d.ts +++ b/apps/files/src/eventbus.d.ts @@ -3,9 +3,12 @@ import type { Node } from '@nextcloud/files' declare module '@nextcloud/event-bus' { export interface NextcloudEvents { // mapping of 'event name' => 'event type' - 'files:favorites:removed': Node 'files:favorites:added': Node + 'files:favorites:removed': Node + 'files:node:created': Node + 'files:node:deleted': Node 'files:node:renamed': Node + 'files:node:updated': Node 'nextcloud:unified-search.search': { query: string } } } diff --git a/apps/files/src/store/files.ts b/apps/files/src/store/files.ts index e2d83d6c65fd9..1637f1195e742 100644 --- a/apps/files/src/store/files.ts +++ b/apps/files/src/store/files.ts @@ -44,9 +44,10 @@ const fetchNode = async (node: Node): Promise => { export const useFilesStore = function(...args) { const store = defineStore('files', { - state: (): FilesState => ({ + state: () => ({ files: {} as FilesStore, roots: {} as RootsStore, + _initialized: false, }), getters: { diff --git a/apps/files/src/store/paths.ts b/apps/files/src/store/paths.ts index e4e520aebba10..342eb260fb48c 100644 --- a/apps/files/src/store/paths.ts +++ b/apps/files/src/store/paths.ts @@ -34,7 +34,8 @@ export const usePathsStore = function(...args) { const store = defineStore('paths', { state: () => ({ paths: {} as ServicesState, - } as PathsStore), + _initialized: false, + }), getters: { getPath: (state) => {