diff --git a/src/lib/gallery-store.ts b/src/lib/gallery-store.ts index 37bc905..1395253 100644 --- a/src/lib/gallery-store.ts +++ b/src/lib/gallery-store.ts @@ -117,11 +117,12 @@ export async function loadGallery(userId?: string | null): Promise<{ } const supabase = createClient(); - const [{ data: albums }, { data: photos }, { data: videos }] = await Promise.all([ + const [{ data: albums }, { data: photos }, videoResult] = await Promise.all([ supabase.from("gallery_albums").select("*").eq("user_id", userId).order("sort_order"), supabase.from("gallery_photos").select("*").eq("user_id", userId).order("sort_order"), supabase.from("gallery_videos").select("*").eq("user_id", userId).order("sort_order"), ]); + const videos = videoResult.error ? [] : videoResult.data; return { albums: (albums as GalleryAlbum[])?.length