fix(files): update @nextcloud/files and fix event store update

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/37633/head
John Molakvoæ 1 year ago
parent a16703d181
commit e3f575ba7a
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF

@ -81,34 +81,26 @@ export const useFilesStore = () => {
Vue.set(this.roots, service, root)
},
onCreatedNode() {
// TODO: do something
},
onDeletedNode(node: Node) {
this.deleteNodes([node])
},
onMovedNode() {
// TODO: do something
},
}
})
const fileStore = store()
// Make sure we only register the listeners once
if (!fileStore.initialized) {
subscribe('files:file:created', fileStore.onCreatedNode)
if (!fileStore._initialized) {
// subscribe('files:file:created', fileStore.onCreatedNode)
subscribe('files:file:deleted', fileStore.onDeletedNode)
subscribe('files:file:moved', fileStore.onMovedNode)
// subscribe('files:file:moved', fileStore.onMovedNode)
// subscribe('files:file:updated', fileStore.onUpdatedNode)
subscribe('files:folder:created', fileStore.onCreatedNode)
// subscribe('files:folder:created', fileStore.onCreatedNode)
subscribe('files:folder:deleted', fileStore.onDeletedNode)
subscribe('files:folder:moved', fileStore.onMovedNode)
// subscribe('files:folder:moved', fileStore.onMovedNode)
// subscribe('files:folder:updated', fileStore.onUpdatedNode)
fileStore.initialized = true
fileStore._initialized = true
}
return fileStore

@ -56,13 +56,13 @@ export const usePathsStore = () => {
const pathsStore = store()
// Make sure we only register the listeners once
if (!pathsStore.initialized) {
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)
pathsStore.initialized = true
pathsStore._initialized = true
}
return pathsStore

@ -63,11 +63,11 @@ export const useUserConfigStore = () => {
const userConfigStore = store()
// Make sure we only register the listeners once
if (!userConfigStore.initialized) {
if (!userConfigStore._initialized) {
subscribe('files:config:updated', function({ key, value }: { key: string, value: boolean }) {
userConfigStore.onUpdate(key, value)
})
userConfigStore.initialized = true
userConfigStore._initialized = true
}
return userConfigStore

19
package-lock.json generated

@ -19,7 +19,7 @@
"@nextcloud/capabilities": "^1.0.4",
"@nextcloud/dialogs": "^4.0.0-beta.2",
"@nextcloud/event-bus": "^3.0.2",
"@nextcloud/files": "^3.0.0-beta.7",
"@nextcloud/files": "^3.0.0-beta.8",
"@nextcloud/initial-state": "^2.0.0",
"@nextcloud/l10n": "^2.1.0",
"@nextcloud/logger": "^2.5.0",
@ -4134,12 +4134,13 @@
}
},
"node_modules/@nextcloud/files": {
"version": "3.0.0-beta.7",
"license": "AGPL-3.0-or-later",
"version": "3.0.0-beta.8",
"resolved": "https://registry.npmjs.org/@nextcloud/files/-/files-3.0.0-beta.8.tgz",
"integrity": "sha512-qzL5lKhm913mBzu//rFnKobZ5GI8iAQ7GwVUez3Gpmso6TyEm/kdSloK2dRNWHStFotQdQRbl75KoyCyoz4cXg==",
"dependencies": {
"@nextcloud/auth": "^2.0.0",
"@nextcloud/l10n": "^2.0.1",
"@nextcloud/logger": "^2.1.0"
"@nextcloud/l10n": "^2.1.0",
"@nextcloud/logger": "^2.5.0"
},
"engines": {
"node": "^16.0.0",
@ -28346,11 +28347,13 @@
}
},
"@nextcloud/files": {
"version": "3.0.0-beta.7",
"version": "3.0.0-beta.8",
"resolved": "https://registry.npmjs.org/@nextcloud/files/-/files-3.0.0-beta.8.tgz",
"integrity": "sha512-qzL5lKhm913mBzu//rFnKobZ5GI8iAQ7GwVUez3Gpmso6TyEm/kdSloK2dRNWHStFotQdQRbl75KoyCyoz4cXg==",
"requires": {
"@nextcloud/auth": "^2.0.0",
"@nextcloud/l10n": "^2.0.1",
"@nextcloud/logger": "^2.1.0"
"@nextcloud/l10n": "^2.1.0",
"@nextcloud/logger": "^2.5.0"
}
},
"@nextcloud/initial-state": {

@ -44,7 +44,7 @@
"@nextcloud/capabilities": "^1.0.4",
"@nextcloud/dialogs": "^4.0.0-beta.2",
"@nextcloud/event-bus": "^3.0.2",
"@nextcloud/files": "^3.0.0-beta.7",
"@nextcloud/files": "^3.0.0-beta.8",
"@nextcloud/initial-state": "^2.0.0",
"@nextcloud/l10n": "^2.1.0",
"@nextcloud/logger": "^2.5.0",

Loading…
Cancel
Save