Skip to content

Commit 3844217

Browse files
authored
Merge pull request #45988 from nextcloud/backport/45963/stable29
2 parents 8abf72b + 30e88f9 commit 3844217

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

apps/files/lib/Controller/ViewController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ private function provideInitialState(string $dir, ?string $fileid): void {
319319
}
320320

321321
$this->initialState->provideInitialState(
322-
'openFileInfo', [
322+
'fileInfo', [
323323
'id' => $node->getId(),
324324
'name' => $isRoot ? '' : $node->getName(),
325325
'path' => $path,

apps/files/src/components/FilesListVirtual.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ export default defineComponent({
222222
const mainContent = window.document.querySelector('main.app-content') as HTMLElement
223223
mainContent.addEventListener('dragover', this.onDragOver)
224224
225-
// handle initially opening a given file
226-
const { id } = loadState<{ id?: number }>('files', 'openFileInfo', {})
225+
const { id } = loadState<{ id?: number }>('files', 'fileInfo', {})
227226
this.scrollToFile(id ?? this.fileId)
228227
this.openSidebarForFile(id ?? this.fileId)
229228
this.handleOpenFile(id ?? null)
@@ -264,6 +263,10 @@ export default defineComponent({
264263
* @param fileId File to open
265264
*/
266265
handleOpenFile(fileId: number|null) {
266+
if (!this.openFile) {
267+
return
268+
}
269+
267270
if (fileId === null || this.openFileId === fileId) {
268271
return
269272
}

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)