diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2023-07-25 11:29:38 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-02 17:18:48 +0200 |
commit | 77446325b2e50e99a5ad2181a234091b29f693a2 (patch) | |
tree | 990ecdd730a285a60b7ee06f34df1cc603aa416d /apps/files/src/components/FileEntry.vue | |
parent | 8fa9607f0fb2259be624fe29fb8ab9e0b163c285 (diff) | |
download | nextcloud-server-77446325b2e50e99a5ad2181a234091b29f693a2.tar.gz nextcloud-server-77446325b2e50e99a5ad2181a234091b29f693a2.zip |
fix(files): fix extension with custom displayName
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index c71cf488077..775c868b18e 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -85,7 +85,7 @@ <span class="files-list__row-name-text"> <!-- Keep the displayName stuck to the extension to avoid whitespace rendering issues--> <span class="files-list__row-name-" v-text="displayName" /> - <span class="files-list__row-name-ext" v-text="source.extension" /> + <span class="files-list__row-name-ext" v-text="extension" /> </span> </a> </td> @@ -157,6 +157,7 @@ import { debounce } from 'debounce' import { emit } from '@nextcloud/event-bus' import { formatFileSize, Permission } from '@nextcloud/files' import { Fragment } from 'vue-frag' +import { extname } from 'path' import { showError, showSuccess } from '@nextcloud/dialogs' import { translate } from '@nextcloud/l10n' import { generateUrl } from '@nextcloud/router' @@ -290,8 +291,15 @@ export default Vue.extend({ fileid() { return this.source?.fileid?.toString?.() }, + + extension() { + if (this.source.attributes?.displayName) { + return extname(this.source.attributes.displayName) + } + return this.source.extension || '' + }, displayName() { - const ext = (this.source.extension || '') + const ext = this.extension const name = (this.source.attributes.displayName || this.source.basename) |