From 339abe4c84f086120b5da7458473065e5137e479 Mon Sep 17 00:00:00 2001 From: nquidox Date: Sun, 26 Oct 2025 21:33:06 +0300 Subject: [PATCH] get image update --- .../CollectionView/CollectionMerchCard.vue | 17 ++++++++++---- src/views/DetailsView/DetailsViewImages.vue | 23 +++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) 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) } } }) -