From 4c5e95a117e408bc9c8b20023c71439d9b5d1ebc Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 15 Nov 2024 07:18:31 -0700 Subject: [PATCH] Add preloading of ad image --- src/components/PageSponsors/StickyTopSponsor.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/PageSponsors/StickyTopSponsor.tsx b/src/components/PageSponsors/StickyTopSponsor.tsx index 71727dde7..817e2c8d1 100644 --- a/src/components/PageSponsors/StickyTopSponsor.tsx +++ b/src/components/PageSponsors/StickyTopSponsor.tsx @@ -28,6 +28,10 @@ export function StickyTopSponsor(props: StickyTopSponsorProps) { return; } + // preload the image so that we don't see a flicker + const img = new Image(); + img.src = sponsor.imageUrl; + // hide the onboarding strip when the sponsor is visible isOnboardingStripHidden.set(true); }, [sponsor]);