From f93a80bc87a041f4463bb787867bebb7b8ec5c5d Mon Sep 17 00:00:00 2001 From: LyAhn Date: Wed, 8 Apr 2026 17:15:44 +0100 Subject: [PATCH] fix: refresh lightbox tags live after AI tagging, hide AI tags button for video --- src/components/Lightbox.tsx | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/components/Lightbox.tsx b/src/components/Lightbox.tsx index cb3af78..2af2a0b 100644 --- a/src/components/Lightbox.tsx +++ b/src/components/Lightbox.tsx @@ -102,7 +102,12 @@ export function Lightbox() { void getImageTags(selectedImage.id) .then(setImageTags) .catch(() => setImageTags([])); - }, [selectedImage?.id, getImageTags]); + }, [selectedImage?.id, selectedImage?.ai_tagged_at, getImageTags]); + + // Reset the queued state once the worker finishes so the button is usable again + useEffect(() => { + if (selectedImage?.ai_tagged_at) setTaggingQueued(false); + }, [selectedImage?.ai_tagged_at]); useEffect(() => { const viewport = imageViewportRef.current; @@ -359,17 +364,19 @@ export function Lightbox() { {ratingPill(selectedImage.ai_rating).label} ) : null} - + {selectedImage.media_kind === "image" ? ( + + ) : null}