Skip to content

Commit e78c4f4

Browse files
authored
Merge pull request #45987 from nextcloud/backport/45963/stable28
[stable28] Rename openFileInfo to fileInfo
2 parents 6b00b80 + c8b5baa commit e78c4f4

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
@@ -341,7 +341,7 @@ private function provideInitialState(string $dir, ?string $fileid): void {
341341
}
342342

343343
$this->initialState->provideInitialState(
344-
'openFileInfo', [
344+
'fileInfo', [
345345
'id' => $node->getId(),
346346
'name' => $isRoot ? '' : $node->getName(),
347347
'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)