mirror of
https://github.com/nextcloud/server.git
synced 2026-07-16 23:12:04 -04:00
fix(files): wait for nodes to be fetched before checking for opendetails or openfile
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
parent
33a69bf985
commit
2d45420722
1 changed files with 24 additions and 27 deletions
|
|
@ -157,7 +157,6 @@ export default defineComponent({
|
|||
FileEntry,
|
||||
FileEntryGrid,
|
||||
scrollToIndex: 0,
|
||||
openFileId: null as number|null,
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -222,39 +221,37 @@ export default defineComponent({
|
|||
isNoneSelected() {
|
||||
return this.selectedNodes.length === 0
|
||||
},
|
||||
|
||||
isEmpty() {
|
||||
return this.nodes.length === 0
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
fileId: {
|
||||
handler(fileId) {
|
||||
this.scrollToFile(fileId, false)
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
// If nodes gets populated and we have a fileId,
|
||||
// an openFile or openDetails, we fire the appropriate actions.
|
||||
isEmpty(isEmpty: boolean) {
|
||||
if (isEmpty || !this.fileId) {
|
||||
return
|
||||
}
|
||||
|
||||
openFile: {
|
||||
handler(openFile) {
|
||||
if (!openFile || !this.fileId) {
|
||||
return
|
||||
}
|
||||
logger.debug('FilesListVirtual: nodes populated, checking for requested fileId, openFile or openDetails again', {
|
||||
fileId: this.fileId,
|
||||
openFile: this.openFile,
|
||||
openDetails: this.openDetails,
|
||||
})
|
||||
|
||||
if (this.openFile) {
|
||||
this.handleOpenFile(this.fileId)
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
}
|
||||
|
||||
openDetails: {
|
||||
handler(openDetails) {
|
||||
// wait for scrolling and updating the actions to settle
|
||||
this.$nextTick(() => {
|
||||
if (!openDetails || !this.fileId) {
|
||||
return
|
||||
}
|
||||
if (this.openDetails) {
|
||||
this.openSidebarForFile(this.fileId)
|
||||
}
|
||||
|
||||
this.openSidebarForFile(this.fileId)
|
||||
})
|
||||
},
|
||||
immediate: true,
|
||||
if (this.fileId) {
|
||||
this.scrollToFile(this.fileId, false)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -293,7 +290,7 @@ export default defineComponent({
|
|||
sidebarAction.exec(node, this.currentView, this.currentFolder.path)
|
||||
return
|
||||
}
|
||||
logger.error(`Failed to open sidebar on file ${fileId}, file isn't cached yet !`, { fileId, node })
|
||||
logger.warn(`Failed to open sidebar on file ${fileId}, file isn't cached yet !`, { fileId, node })
|
||||
},
|
||||
|
||||
scrollToFile(fileId: number|null, warn = true) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue