Skip to content

Commit d7206aa

Browse files
committed
fix(files): do not even try to fetch a preview if èhas-preview` is false
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent 0b626f5 commit d7206aa

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

apps/files/src/components/FileEntry/FileEntryPreview.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<!-- Decorative image, should not be aria documented -->
1818
<img v-else-if="previewUrl && backgroundFailed !== true"
19+
:key="source.fileid"
1920
ref="previewImg"
2021
alt=""
2122
class="files-list__row-icon-preview"
@@ -134,6 +135,17 @@ export default Vue.extend({
134135
return null
135136
}
136137
138+
if (this.source.attributes['has-preview'] !== true
139+
&& this.source.mime !== undefined
140+
&& this.source.mime !== 'application/octet-stream'
141+
) {
142+
const previewUrl = generateUrl('/core/mimeicon?mime={mime}', {
143+
mime: this.source.mime,
144+
})
145+
const url = new URL(window.location.origin + previewUrl)
146+
return url.href
147+
}
148+
137149
try {
138150
const previewUrl = this.source.attributes.previewUrl
139151
|| generateUrl('/core/preview?fileId={fileid}', {

0 commit comments

Comments
 (0)