bug: remove empty images on new creator.
This commit is contained in:
@@ -156,7 +156,7 @@ const videoUrlError = ref("");
|
|||||||
// Computed property to check if there are images
|
// Computed property to check if there are images
|
||||||
const hasImages = computed(() => {
|
const hasImages = computed(() => {
|
||||||
// Only consider it has images if there are actual image URLs (not empty strings)
|
// 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
|
// Computed property for YouTube embed URL
|
||||||
@@ -215,15 +215,15 @@ async function fetchAlbumData() {
|
|||||||
// Extract photo URLs from the album photos
|
// Extract photo URLs from the album photos
|
||||||
imageUrls.value = response.data.photos.map(photo => photo.photoUrl);
|
imageUrls.value = response.data.photos.map(photo => photo.photoUrl);
|
||||||
} else {
|
} else {
|
||||||
// Initialize with empty slots for adding new photos
|
// Initialize with empty array instead of empty slots
|
||||||
imageUrls.value = Array(6).fill("");
|
imageUrls.value = [];
|
||||||
originalPhotos.value = [];
|
originalPhotos.value = [];
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Album might not exist yet, which is fine
|
// Album might not exist yet, which is fine
|
||||||
console.log("Album might not exist yet:", error);
|
console.log("Album might not exist yet:", error);
|
||||||
// Initialize with empty slots for adding new photos
|
// Initialize with empty array instead of empty slots
|
||||||
imageUrls.value = Array(6).fill("");
|
imageUrls.value = [];
|
||||||
originalPhotos.value = [];
|
originalPhotos.value = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user