bug: remove empty images on new creator.

This commit is contained in:
2025-04-24 04:21:46 -04:00
parent cc3df49848
commit 06ac4c9624

View File

@@ -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 = [];
}
}