diff --git a/apps/files/src/eventbus.d.ts b/apps/files/src/eventbus.d.ts index c025564d22744..e30ea3ffc2816 100644 --- a/apps/files/src/eventbus.d.ts +++ b/apps/files/src/eventbus.d.ts @@ -12,6 +12,8 @@ declare module '@nextcloud/event-bus' { 'files:config:updated': { key: string, value: UserConfig[string] } 'files:view-config:updated': { key: string, value: string | number | boolean, IView: string } + 'files:list:initialized': undefined + 'files:favorites:added': INode 'files:favorites:removed': INode diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue index 80bc4f1081f2a..9790e639dd535 100644 --- a/apps/files/src/views/FilesList.vue +++ b/apps/files/src/views/FilesList.vue @@ -285,6 +285,8 @@ export default defineComponent({ data() { return { + initialized: false, + loading: true, loadingAction: null as string | null, error: null as string | null, @@ -497,6 +499,15 @@ export default defineComponent({ currentFolder() { this.activeStore.activeFolder = this.currentFolder + + // if not already initialized and we have a valid folder, we can consider the list as initialized + if (!this.initialized + && this.currentFolder.fileid + && this.currentFolder.fileid > 0 + ) { + this.initialized = true + this.$nextTick(async () => emit('files:list:initialized')) + } }, currentView(newView, oldView) { diff --git a/apps/files/src/views/FilesNavigation.vue b/apps/files/src/views/FilesNavigation.vue index f070049923d41..bd6dbf1d1f1ae 100644 --- a/apps/files/src/views/FilesNavigation.vue +++ b/apps/files/src/views/FilesNavigation.vue @@ -43,12 +43,12 @@