aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/views/FilesList.vue18
1 files changed, 17 insertions, 1 deletions
diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue
index 6ab01b5e7d6..98a6a470235 100644
--- a/apps/files/src/views/FilesList.vue
+++ b/apps/files/src/views/FilesList.vue
@@ -105,7 +105,7 @@ import type { Upload } from '@nextcloud/upload'
import type { UserConfig } from '../types.ts'
import type { View, ContentsWithRoot } from '@nextcloud/files'
-import { emit } from '@nextcloud/event-bus'
+import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import { Folder, Node, Permission } from '@nextcloud/files'
import { getCapabilities } from '@nextcloud/capabilities'
import { join, dirname } from 'path'
@@ -406,6 +406,11 @@ export default defineComponent({
mounted() {
this.fetchContent()
+ subscribe('files:node:updated', this.onUpdatedNode)
+ },
+
+ unmounted() {
+ unsubscribe('files:node:updated', this.onUpdatedNode)
},
methods: {
@@ -493,6 +498,17 @@ export default defineComponent({
}
},
+ /**
+ * Refreshes the current folder on update.
+ *
+ * @param {Node} node is the file/folder being updated.
+ */
+ onUpdatedNode(node) {
+ if (node?.fileid === this.currentFolder?.fileid) {
+ this.fetchContent()
+ }
+ },
+
openSharingSidebar() {
if (window?.OCA?.Files?.Sidebar?.setActiveTab) {
window.OCA.Files.Sidebar.setActiveTab('sharing')