aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files/lib/Controller/ViewController.php2
-rw-r--r--apps/files/src/components/FilesListVirtual.vue7
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
}