mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(files): standardize files:node:event event syntax
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
parent
0951398af8
commit
edbdfefcb8
9 changed files with 19 additions and 29 deletions
|
|
@ -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 })
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files_trashbin-main.js
vendored
4
dist/files_trashbin-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_trashbin-main.js.map
vendored
2
dist/files_trashbin-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue