From d7814329105d935cec25251ca9d93878ef6028df Mon Sep 17 00:00:00 2001 From: pollutri Date: Fri, 8 May 2026 11:13:23 +0200 Subject: [PATCH] Fix Fullscreen bug --- components/PublicGrid.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/PublicGrid.tsx b/components/PublicGrid.tsx index 10ad7cd..2866655 100644 --- a/components/PublicGrid.tsx +++ b/components/PublicGrid.tsx @@ -342,11 +342,9 @@ export default function PublicGrid({ cards, maxCols = 5 }: { cards: Card[], maxC key={card.id} onClick={() => { setActiveCard(card); - // If any extraMedia item is flagged auto-fullscreen, open it immediately. - // The carousel's index 0 is the cover image; extraMedia starts at offset 1 (or 0 if no cover). - const offset = card.imageUrl ? 1 : 0; - const idx = (card.extraMedia || []).findIndex(m => m.autoFullscreen); - if (idx >= 0) setFullscreenIndex(offset + idx); + // If any media item is flagged auto-fullscreen, open the viewer from the start. + const triggers = (card.extraMedia || []).some(m => m.autoFullscreen); + if (triggers) setFullscreenIndex(0); }} className="group relative cursor-pointer overflow-hidden rounded-xl shadow-md aspect-square bg-gray-200 transition-all duration-300 hover:shadow-xl hover:-translate-y-1" >