From 28bcb96ec7d5c79c66bf00309f10b1b226e529cd Mon Sep 17 00:00:00 2001 From: Anthony Date: Tue, 4 Jan 2022 17:55:59 +0100 Subject: [PATCH] autoscroll on home page and dont run ads js at all for firefox android --- ui/page/home/view.jsx | 3 +++ web/component/ads/view.jsx | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/page/home/view.jsx b/ui/page/home/view.jsx index b32f84011..6fcb4537c 100644 --- a/ui/page/home/view.jsx +++ b/ui/page/home/view.jsx @@ -236,6 +236,9 @@ function HomePage(props: Props) { // delete last card to not introduce layout shifts lastCard.remove(); + + // addresses bug where ad doesn't show up until a scroll event + document.dispatchEvent(new CustomEvent('scroll')); } } checkFlag(); diff --git a/web/component/ads/view.jsx b/web/component/ads/view.jsx index 712db2d2d..a9a43b2ed 100644 --- a/web/component/ads/view.jsx +++ b/web/component/ads/view.jsx @@ -53,6 +53,8 @@ function Ads(props: Props) { triggerBlacklist, } = props; + const shouldShowAds = SHOW_ADS && !authenticated; + // load ad and tags here let scriptUrlToUse; let tagNameToUse; @@ -71,7 +73,9 @@ function Ads(props: Props) { // add script to DOM useEffect(() => { - if (SHOW_ADS && !authenticated) { + if (isFirefoxAndroid) return; + + if (shouldShowAds) { let script; try { script = document.createElement('script');