Skip to content

Commit 502e57d

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 3aae7ae commit 502e57d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
class="files-list__row-icon-blurhash"
2222
aria-hidden="true" />
2323
<img v-if="backgroundFailed !== true"
24+
:key="source.fileid"
2425
ref="previewImg"
2526
alt=""
2627
class="files-list__row-icon-preview"
@@ -147,6 +148,17 @@ export default defineComponent({
147148
return null
148149
}
149150
151+
if (this.source.attributes['has-preview'] !== true
152+
&& this.source.mime !== undefined
153+
&& this.source.mime !== 'application/octet-stream'
154+
) {
155+
const previewUrl = generateUrl('/core/mimeicon?mime={mime}', {
156+
mime: this.source.mime,
157+
})
158+
const url = new URL(window.location.origin + previewUrl)
159+
return url.href
160+
}
161+
150162
try {
151163
const previewUrl = this.source.attributes.previewUrl
152164
|| (this.isPublic

0 commit comments

Comments
 (0)