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 GitHub
parent 687b68246b
commit c75d30d902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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}