From edbdfefcb8f1dffa2b568b4dbd88f73cbb21133d Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Fri, 14 Apr 2023 09:23:42 +0200 Subject: fix(files): standardize `files:node:event` event syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/files/src/actions/deleteAction.ts | 2 +- apps/files/src/components/NavigationQuota.vue | 13 ++++--------- apps/files/src/store/files.ts | 13 ++++--------- apps/files/src/store/paths.ts | 6 +++--- 4 files changed, 12 insertions(+), 22 deletions(-) (limited to 'apps/files/src') diff --git a/apps/files/src/actions/deleteAction.ts b/apps/files/src/actions/deleteAction.ts index d8ed4d35204..087884b3362 100644 --- a/apps/files/src/actions/deleteAction.ts +++ b/apps/files/src/actions/deleteAction.ts @@ -50,7 +50,7 @@ registerFileAction(new FileAction({ // Let's delete even if it's moved to the trashbin // since it has been removed from the current view // and changing the view will trigger a reload anyway. - emit('files:file:deleted', node) + emit('files:node:deleted', node) return true } catch (error) { logger.error('Error while deleting a file', { error, source: node.source, node }) diff --git a/apps/files/src/components/NavigationQuota.vue b/apps/files/src/components/NavigationQuota.vue index bfcbaea3776..d38d4d2fd9e 100644 --- a/apps/files/src/components/NavigationQuota.vue +++ b/apps/files/src/components/NavigationQuota.vue @@ -80,15 +80,10 @@ export default { */ setInterval(this.throttleUpdateStorageStats, 60 * 1000) - subscribe('files:file:created', this.throttleUpdateStorageStats) - subscribe('files:file:deleted', this.throttleUpdateStorageStats) - subscribe('files:file:moved', this.throttleUpdateStorageStats) - subscribe('files:file:updated', this.throttleUpdateStorageStats) - - subscribe('files:folder:created', this.throttleUpdateStorageStats) - subscribe('files:folder:deleted', this.throttleUpdateStorageStats) - subscribe('files:folder:moved', this.throttleUpdateStorageStats) - subscribe('files:folder:updated', this.throttleUpdateStorageStats) + subscribe('files:node:created', this.throttleUpdateStorageStats) + subscribe('files:node:deleted', this.throttleUpdateStorageStats) + subscribe('files:node:moved', this.throttleUpdateStorageStats) + subscribe('files:node:updated', this.throttleUpdateStorageStats) }, methods: { diff --git a/apps/files/src/store/files.ts b/apps/files/src/store/files.ts index d276b6bf0b7..11e4fc970a4 100644 --- a/apps/files/src/store/files.ts +++ b/apps/files/src/store/files.ts @@ -91,15 +91,10 @@ export const useFilesStore = () => { const fileStore = store() // Make sure we only register the listeners once if (!fileStore._initialized) { - // subscribe('files:file:created', fileStore.onCreatedNode) - subscribe('files:file:deleted', fileStore.onDeletedNode) - // subscribe('files:file:moved', fileStore.onMovedNode) - // subscribe('files:file:updated', fileStore.onUpdatedNode) - - // subscribe('files:folder:created', fileStore.onCreatedNode) - subscribe('files:folder:deleted', fileStore.onDeletedNode) - // subscribe('files:folder:moved', fileStore.onMovedNode) - // subscribe('files:folder:updated', fileStore.onUpdatedNode) + // subscribe('files:node:created', fileStore.onCreatedNode) + subscribe('files:node:deleted', fileStore.onDeletedNode) + // subscribe('files:node:moved', fileStore.onMovedNode) + // subscribe('files:node:updated', fileStore.onUpdatedNode) fileStore._initialized = true } diff --git a/apps/files/src/store/paths.ts b/apps/files/src/store/paths.ts index 28cd55be25a..bcd7375518c 100644 --- a/apps/files/src/store/paths.ts +++ b/apps/files/src/store/paths.ts @@ -59,9 +59,9 @@ export const usePathsStore = () => { // Make sure we only register the listeners once if (!pathsStore._initialized) { // TODO: watch folders to update paths? - // subscribe('files:folder:created', pathsStore.onCreatedNode) - // subscribe('files:folder:deleted', pathsStore.onDeletedNode) - // subscribe('files:folder:moved', pathsStore.onMovedNode) + // subscribe('files:node:created', pathsStore.onCreatedNode) + // subscribe('files:node:deleted', pathsStore.onDeletedNode) + // subscribe('files:node:moved', pathsStore.onMovedNode) pathsStore._initialized = true } -- cgit v1.2.3