From 51f2f56b4bc9bd9883857563b9ada57bdb79ba2f Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Fri, 21 Apr 2023 15:58:40 +0200 Subject: fix(files): do not execute the default action on folders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/files/src/components/FileEntry.vue | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'apps/files') diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index d4258f29861..8dc067a407d 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -262,6 +262,15 @@ export default Vue.extend({ }, linkTo() { + if (this.source.type === 'folder') { + const to = { ...this.$route, query: { dir: join(this.dir, this.source.basename) } } + return { + is: 'router-link', + title: this.t('files', 'Open folder {name}', { name: this.displayName }), + to, + } + } + if (this.enabledDefaultActions.length > 0) { const action = this.enabledDefaultActions[0] const displayName = action.displayName([this.source], this.currentView) @@ -271,14 +280,6 @@ export default Vue.extend({ } } - if (this.source.type === 'folder') { - const to = { ...this.$route, query: { dir: join(this.dir, this.source.basename) } } - return { - is: 'router-link', - title: this.t('files', 'Open folder {name}', { name: this.displayName }), - to, - } - } return { href: this.source.source, // TODO: Use first action title ? @@ -525,6 +526,11 @@ export default Vue.extend({ } }, execDefaultAction(event) { + // Do not execute the default action on the folder, navigate instead + if (this.source.type === 'folder') { + return + } + if (this.enabledDefaultActions.length > 0) { event.preventDefault() event.stopPropagation() -- cgit v1.2.3