Skip to content
Open
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
6 changes: 6 additions & 0 deletions apps/files/src/components/FilesListVirtual.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:data-component="userConfig.grid_view ? FileEntryGrid : FileEntry"
data-key="source"
:data-sources="nodes"
:loading="loading"
:grid-mode="userConfig.grid_view"
:extra-props="{
isMimeAvailable,
Expand Down Expand Up @@ -129,6 +130,11 @@ export default defineComponent({
type: String,
required: true,
},

loading: {
type: Boolean,
default: false,
},
},

setup(props) {
Expand Down
8 changes: 7 additions & 1 deletion apps/files/src/components/VirtualList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
</div>

<div
v-if="dataSources.length === 0"
v-if="dataSources.length === 0 || loading"
class="files-list__empty">
<slot name="empty" />
</div>

<table
v-if="!loading"
:aria-hidden="dataSources.length === 0"
:inert="dataSources.length === 0"
class="files-list__table"
Expand Down Expand Up @@ -128,6 +129,11 @@ export default defineComponent({
type: String,
default: '',
},

loading: {
type: Boolean,
default: false,
},
},

setup() {
Expand Down
6 changes: 6 additions & 0 deletions apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<FilesListVirtual
v-else
ref="filesListVirtual"
:loading="loading && !isRefreshing"
:current-folder="currentFolder"
:current-view="currentView"
:nodes="dirContentsSorted"
Expand Down Expand Up @@ -311,6 +312,7 @@ export default defineComponent({

loading: true,
loadingAction: null as string | null,
changingLocation: false,
error: null as string | null,
controller: new AbortController(),
promise: null as Promise<ContentsWithRoot> | null,
Expand Down Expand Up @@ -410,6 +412,7 @@ export default defineComponent({
return this.currentFolder !== undefined
&& !this.isEmptyDir
&& this.loading
&& !this.changingLocation
},

/**
Expand Down Expand Up @@ -476,12 +479,14 @@ export default defineComponent({
}

logger.debug('View changed', { newView, oldView })
this.changingLocation = true
this.selectionStore.reset()
this.fetchContent()
},

directory(newDir, oldDir) {
logger.debug('Directory changed', { newDir, oldDir })
this.changingLocation = true
// TODO: preserve selection on browsing?
this.selectionStore.reset()
this.sidebar.close()
Expand Down Expand Up @@ -608,6 +613,7 @@ export default defineComponent({
this.error = humanizeWebDAVError(error)
} finally {
this.loading = false
this.changingLocation = false
}
},

Expand Down
Loading