fix(files): pass Node to FileInfo object

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2025-09-01 22:02:51 +02:00 committed by Carl Schwan
parent 59e9d19e83
commit a7f7ae2770
2 changed files with 4 additions and 1 deletions

View file

@ -31,6 +31,7 @@ export default function(node: Node) {
fileInfo.get = (key) => fileInfo[key]
fileInfo.isDirectory = () => fileInfo.mimetype === 'httpd/unix-directory'
fileInfo.canEdit = () => Boolean(fileInfo.permissions & OC.PERMISSION_UPDATE)
fileInfo.node = node
return fileInfo
}

View file

@ -95,6 +95,8 @@
</NcAppSidebar>
</template>
<script lang="ts">
import type { INode } from '@nextcloud/files'
import { davRemoteURL, davRootPath, File, Folder, formatFileSize } from '@nextcloud/files'
import { defineComponent } from 'vue'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
@ -159,7 +161,7 @@ export default defineComponent({
error: null,
loading: true,
fileInfo: null,
node: null,
node: null as INode | null,
isFullScreen: false,
hasLowHeight: false,
}