Ensure alertVideos persistence is loaded before displaying thumb or preview (#19432)

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:52:58 -05:00
committed by Blake Blackshear
parent fcf3824124
commit 21ab164bfe

View File

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