diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-07-28 12:32:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 12:32:56 +0200 |
commit | 6d9cf9e2996ee3ffcd9eba824df3d1557f1b8f3f (patch) | |
tree | 53930c208dc318cb61d8ac040994c0f1ddb0d9ef /apps/files | |
parent | 56a6037cd6aef123073d9f5c06c6659337a3e1d4 (diff) | |
parent | b575404a942ad4de89dca7fad34d5d30aa7a6eb4 (diff) | |
download | nextcloud-server-6d9cf9e2996ee3ffcd9eba824df3d1557f1b8f3f.tar.gz nextcloud-server-6d9cf9e2996ee3ffcd9eba824df3d1557f1b8f3f.zip |
Merge pull request #39566 from nextcloud/fix/filename-files
[stable27] fix(files): fix extension with custom displayName
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index db32f2fab35..6509e3b3bce 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -62,7 +62,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-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> @@ -121,7 +121,7 @@ import { debounce } from 'debounce' import { formatFileSize } from '@nextcloud/files' import { Fragment } from 'vue-frag' -import { join } from 'path' +import { join, extname } from 'path' import { showError, showSuccess } from '@nextcloud/dialogs' import { translate } from '@nextcloud/l10n' import CancelablePromise from 'cancelable-promise' @@ -240,8 +240,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) |