diff --git a/src/views/CollectionView/CollectionMerchCard.vue b/src/views/CollectionView/CollectionMerchCard.vue index 513daea..bb90992 100644 --- a/src/views/CollectionView/CollectionMerchCard.vue +++ b/src/views/CollectionView/CollectionMerchCard.vue @@ -15,22 +15,29 @@ const fileList = ref([]) onMounted(async () => { try { - const imgUrl = await getImageUrl(props.merch.merch_uuid, 'thumbnail') + const imgUrl = getImageUrl(props.merch.merch_uuid, 'thumbnail') + + await new Promise((resolve, reject) => { + const img = new Image() + img.src = imgUrl + img.onload = () => resolve(imgUrl) + img.onerror = () => reject(new Error('Image not found')) + }) + fileList.value = [ { - name: 'full.jpg', + name: 'thumbnail.jpg', url: imgUrl, status: 'finished', }, ] } catch (error) { fileList.value = [] - if (!error.message?.includes('404')) { - console.error('Error getting image: ', error) + if (!error.message.includes('404')) { + console.error('Error getting thumbnail: ', error) } } }) -