Merge pull request #45987 from nextcloud/backport/45963/stable28

[stable28] Rename openFileInfo to fileInfo
This commit is contained in:
Louis 2024-07-01 23:20:03 +02:00 committed by GitHub
commit e78c4f4018
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 6 deletions

View file

@ -341,7 +341,7 @@ class ViewController extends Controller {
}
$this->initialState->provideInitialState(
'openFileInfo', [
'fileInfo', [
'id' => $node->getId(),
'name' => $isRoot ? '' : $node->getName(),
'path' => $path,

View file

@ -222,8 +222,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)
@ -264,6 +263,10 @@ export default defineComponent({
* @param fileId File to open
*/
handleOpenFile(fileId: number|null) {
if (!this.openFile) {
return
}
if (fileId === null || this.openFileId === fileId) {
return
}

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long