Skip to content
Closed
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
9 changes: 8 additions & 1 deletion src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down