diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-06-19 17:04:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 17:04:42 +0200 |
commit | 18cf61df9f641681b599ed2d693ac09803ef5370 (patch) | |
tree | 56bac3ecdd4c3f0d0aebe203fe6edce43c87228e /apps/files | |
parent | 42fa0072046b3258062b50dbbd29110adefa1d71 (diff) | |
parent | 59ea179dd8f5e6e760ed3e37b00d1f6e5fed10e8 (diff) | |
download | nextcloud-server-18cf61df9f641681b599ed2d693ac09803ef5370.tar.gz nextcloud-server-18cf61df9f641681b599ed2d693ac09803ef5370.zip |
Merge pull request #45963 from nextcloud/artonge/fix/openfile
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/lib/Controller/ViewController.php | 2 | ||||
-rw-r--r-- | apps/files/src/components/FilesListVirtual.vue | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 84bede683c5..ed01efe0ebb 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -292,7 +292,7 @@ class ViewController extends Controller { } $this->initialState->provideInitialState( - 'openFileInfo', [ + 'fileInfo', [ 'id' => $node->getId(), 'name' => $isRoot ? '' : $node->getName(), 'path' => $path, diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue index 12f4642f227..7c74f2d2d7e 100644 --- a/apps/files/src/components/FilesListVirtual.vue +++ b/apps/files/src/components/FilesListVirtual.vue @@ -206,8 +206,7 @@ export default defineComponent({ const mainContent = window.document.querySelector('main.app-content') as HTMLElement mainContent.addEventListener('dragover', this.onDragOver) - // handle initially opening a given file - const { id } = loadState<{ id?: number }>('files', 'openFileInfo', {}) + const { id } = loadState<{ id?: number }>('files', 'fileInfo', {}) this.scrollToFile(id ?? this.fileId) this.openSidebarForFile(id ?? this.fileId) this.handleOpenFile(id ?? null) @@ -248,6 +247,10 @@ export default defineComponent({ * @param fileId File to open */ handleOpenFile(fileId: number|null) { + if (!this.openFile) { + return + } + if (fileId === null || this.openFileId === fileId) { return } |