fix(files): do not even try to fetch a preview if èhas-preview` is false

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2025-05-14 11:08:04 +02:00 committed by Andy Scherzinger
parent 22e5ebc7b2
commit 1b80db3bef
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -16,6 +16,7 @@
<!-- Decorative image, should not be aria documented -->
<img v-else-if="previewUrl && backgroundFailed !== true"
:key="source.fileid"
ref="previewImg"
alt=""
class="files-list__row-icon-preview"
@ -134,6 +135,17 @@ export default Vue.extend({
return null
}
if (this.source.attributes['has-preview'] !== true
&& this.source.mime !== undefined
&& this.source.mime !== 'application/octet-stream'
) {
const previewUrl = generateUrl('/core/mimeicon?mime={mime}', {
mime: this.source.mime,
})
const url = new URL(window.location.origin + previewUrl)
return url.href
}
try {
const previewUrl = this.source.attributes.previewUrl
|| generateUrl('/core/preview?fileId={fileid}', {