Skip to content

Commit 18cf61d

Browse files
authored
Merge pull request #45963 from nextcloud/artonge/fix/openfile
2 parents 42fa007 + 59ea179 commit 18cf61d

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

294294
$this->initialState->provideInitialState(
295-
'openFileInfo', [
295+
'fileInfo', [
296296
'id' => $node->getId(),
297297
'name' => $isRoot ? '' : $node->getName(),
298298
'path' => $path,

apps/files/src/components/FilesListVirtual.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ export default defineComponent({
206206
const mainContent = window.document.querySelector('main.app-content') as HTMLElement
207207
mainContent.addEventListener('dragover', this.onDragOver)
208208
209-
// handle initially opening a given file
210-
const { id } = loadState<{ id?: number }>('files', 'openFileInfo', {})
209+
const { id } = loadState<{ id?: number }>('files', 'fileInfo', {})
211210
this.scrollToFile(id ?? this.fileId)
212211
this.openSidebarForFile(id ?? this.fileId)
213212
this.handleOpenFile(id ?? null)
@@ -248,6 +247,10 @@ export default defineComponent({
248247
* @param fileId File to open
249248
*/
250249
handleOpenFile(fileId: number|null) {
250+
if (!this.openFile) {
251+
return
252+
}
253+
251254
if (fileId === null || this.openFileId === fileId) {
252255
return
253256
}

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)