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
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 1 deletions

View File

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