fix: unset cover image when the task does not have one

This commit is contained in:
kolaente 2022-10-02 13:39:53 +02:00
parent 3d88fdaadd
commit 054d70cbe5
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -129,12 +129,12 @@ const coverImageBlobUrl = ref<string | null>(null)
async function maybeDownloadCoverImage() { async function maybeDownloadCoverImage() {
if (!props.task.coverImageAttachmentId) { if (!props.task.coverImageAttachmentId) {
coverImageBlobUrl.value = null
return return
} }
const attachment = props.task.attachments.find(a => a.id === props.task.coverImageAttachmentId) const attachment = props.task.attachments.find(a => a.id === props.task.coverImageAttachmentId)
if (!attachment || !SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.endsWith(suffix))) { if (!attachment || !SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.endsWith(suffix))) {
console.log('not an attachment')
return return
} }