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>
pull/39656/head
John Molakvoæ (skjnldsv) 2023-07-25 11:29:38 +07:00 committed by John Molakvoæ
parent 8fa9607f0f
commit 77446325b2
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
7 changed files with 19 additions and 11 deletions

@ -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)

4
dist/1929-1929.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long