Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files): standardize files:node:event event syntax #37726

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/files/src/actions/deleteAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
13 changes: 4 additions & 9 deletions apps/files/src/components/NavigationQuota.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
13 changes: 4 additions & 9 deletions apps/files/src/store/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions apps/files/src/store/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion apps/files_trashbin/src/actions/restoreAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ registerFileAction(new FileAction({

// Let's pretend the file is deleted since
// we don't know the restored location
emit('files:file:deleted', node)
emit('files:node:deleted', node)
return true
} catch (error) {
logger.error(error)
Expand Down
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_trashbin-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_trashbin-main.js.map

Large diffs are not rendered by default.