diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-06-04 17:14:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 17:14:09 +0200 |
commit | a8d317942bf36e539a31601281fb2f448c8bcfb1 (patch) | |
tree | 817f37a615086d2a2ffcfff30709e3914ab715d7 /apps | |
parent | 54165f0811f455bff458ca84931f8447578b39bb (diff) | |
parent | b84820387c58e3ba5fd680ac5a6a6836934a3561 (diff) | |
download | nextcloud-server-a8d317942bf36e539a31601281fb2f448c8bcfb1.tar.gz nextcloud-server-a8d317942bf36e539a31601281fb2f448c8bcfb1.zip |
Merge pull request #45663 from nextcloud/backport/45586/stable28
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/components/FilesListVirtual.vue | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue index d31330f0950..50b42b3f094 100644 --- a/apps/files/src/components/FilesListVirtual.vue +++ b/apps/files/src/components/FilesListVirtual.vue @@ -274,14 +274,18 @@ export default defineComponent({ logger.debug('Opening file ' + node.path, { node }) this.openFileId = fileId - getFileActions() - .filter(action => !action.enabled || action.enabled([node], this.currentView)) + const defaultAction = getFileActions() + // Get only default actions (visible and hidden) + .filter(action => !!action?.default) + // Find actions that are either always enabled or enabled for the current node + .filter((action) => !action.enabled || action.enabled([node], this.currentView)) + // Sort enabled default actions by order .sort((a, b) => (a.order || 0) - (b.order || 0)) - .filter(action => !!action?.default)[0].exec(node, this.currentView, this.currentFolder.path) - }, - - getFileId(node) { - return node.fileid + // Get the first one + .at(0) + // Some file types do not have a default action (e.g. they can only be downloaded) + // So if there is an enabled default action, so execute it + defaultAction?.exec(node, this.currentView, this.currentFolder.path) }, onDragOver(event: DragEvent) { |