Skip to content

Commit 4fc8932

Browse files
authored
fix(viewer): used join to fix issues stemming from nextcloud#2991
While the fix merged in nextcloud#2991 addressed a share, it inadvertently broke navigating through images for regular file viewing. This fix uses the `join`, `dirPath` and `node.basename` to reconstruct the paths that works for both shares and non-shared views. Signed-off-by: tabedzki <35670232+tabedzki@users.noreply.github.com>
1 parent 11389bc commit 4fc8932

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/views/Viewer.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@
178178
import '@nextcloud/dialogs/style.css'
179179
import Vue, { defineComponent } from 'vue'
180180
181+
import { join } from 'path'
182+
183+
181184
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
182185
import { loadState } from '@nextcloud/initial-state'
183186
import { File as NcFile, Node, davRemoteURL, davRootPath, davGetRootPath, sortNodes } from '@nextcloud/files'
@@ -796,7 +799,7 @@ export default defineComponent({
796799
})
797800
798801
this.fileList = sortedNodes.map(node => {
799-
return filteredFiles.find(file => file.filename === String(dirPath + node.path))
802+
return filteredFiles.find(file => file.filename === join(dirPath, node.basename))
800803
})
801804
// store current position
802805
this.currentIndex = this.fileList.findIndex(file => file.filename === fileInfo.filename)

0 commit comments

Comments
 (0)