diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index 5fc9a1f80..79f1af0cc 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -178,6 +178,9 @@ import '@nextcloud/dialogs/style.css' import Vue, { defineComponent } from 'vue' +import { join } from 'path' + + import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus' import { loadState } from '@nextcloud/initial-state' import { File as NcFile, Node, davRemoteURL, davRootPath, davGetRootPath, sortNodes } from '@nextcloud/files' @@ -795,8 +798,12 @@ export default defineComponent({ sortingOrder: this.sortingConfig.asc ? 'asc' : 'desc', }) + let tmp_path + tmp_path = dirPath + if (tmp_path.length === 0 ) {tmp_path = "/"} + this.fileList = sortedNodes.map(node => { - return filteredFiles.find(file => file.filename === String(dirPath + node.path)) + return filteredFiles.find(file => file.filename === join(tmp_path, node.basename)) }) // store current position this.currentIndex = this.fileList.findIndex(file => file.filename === fileInfo.filename)