Ensure alertVideos persistence is loaded before displaying thumb or preview

The default value of true would cause previews to be loaded in the background even if the local storage value was false
This commit is contained in:
Josh Hawkins 2025-08-08 07:37:33 -05:00
parent 687b68246b
commit 48cc27c378

View File

@ -91,7 +91,10 @@ export function AnimatedEventCard({
// image behavior // image behavior
const [alertVideos] = usePersistence("alertVideos", true); const [alertVideos, _, alertVideosLoaded] = usePersistence(
"alertVideos",
true,
);
const aspectRatio = useMemo(() => { const aspectRatio = useMemo(() => {
if ( if (
@ -135,7 +138,7 @@ export function AnimatedEventCard({
<TooltipContent>{t("markAsReviewed")}</TooltipContent> <TooltipContent>{t("markAsReviewed")}</TooltipContent>
</Tooltip> </Tooltip>
)} )}
{previews != undefined && ( {previews != undefined && alertVideosLoaded && (
<div <div
className="size-full cursor-pointer" className="size-full cursor-pointer"
onClick={onOpenReview} onClick={onOpenReview}