From 06ac4c96243f6c4717b8809a13b428f27e5ab176 Mon Sep 17 00:00:00 2001 From: Jonathan Bourdon Date: Thu, 24 Apr 2025 04:21:46 -0400 Subject: [PATCH] bug: remove empty images on new creator. --- frontend/src/views/creators/AboutCreator.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/creators/AboutCreator.vue b/frontend/src/views/creators/AboutCreator.vue index 44156ee..7e08936 100644 --- a/frontend/src/views/creators/AboutCreator.vue +++ b/frontend/src/views/creators/AboutCreator.vue @@ -156,7 +156,7 @@ const videoUrlError = ref(""); // Computed property to check if there are images const hasImages = computed(() => { // Only consider it has images if there are actual image URLs (not empty strings) - return imageUrls.value.some(img => img && img.trim() !== ""); + return imageUrls.value.length > 0 && imageUrls.value.some(img => img && img.trim() !== ""); }); // Computed property for YouTube embed URL @@ -215,15 +215,15 @@ async function fetchAlbumData() { // Extract photo URLs from the album photos imageUrls.value = response.data.photos.map(photo => photo.photoUrl); } else { - // Initialize with empty slots for adding new photos - imageUrls.value = Array(6).fill(""); + // Initialize with empty array instead of empty slots + imageUrls.value = []; originalPhotos.value = []; } } catch (error) { // Album might not exist yet, which is fine console.log("Album might not exist yet:", error); - // Initialize with empty slots for adding new photos - imageUrls.value = Array(6).fill(""); + // Initialize with empty array instead of empty slots + imageUrls.value = []; originalPhotos.value = []; } }