From e70ed61d4e90331f34f856641b2477612789b80c Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Wed, 15 Jun 2022 17:00:23 +0800 Subject: [PATCH] OBR-hack: move AdsSticky up to make it load first We are asking Outbrain to make it order-agnostic, but for now, we need to load the Sticky script first before the Banner script. This is ugly code because the requirement is not obvious unless we put a bunch of comments, but I don't want to pollute `app/view.jsx`. Hopefully they can address this and we can revert in the coming days. --- ui/component/app/view.jsx | 3 +-- web/component/adsSticky/view.jsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index ae44e908e..861101800 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -543,6 +543,7 @@ function App(props: Props) { /> ) : ( + @@ -560,8 +561,6 @@ function App(props: Props) { )} {getStatusNag()} - - )} diff --git a/web/component/adsSticky/view.jsx b/web/component/adsSticky/view.jsx index 7a9a5050a..36619c1e2 100644 --- a/web/component/adsSticky/view.jsx +++ b/web/component/adsSticky/view.jsx @@ -44,7 +44,7 @@ export default function AdsSticky(props: Props) { // Global conditions aside, should the Sticky be shown for this path: const inAllowedPath = shouldShowAdsForPath(location.pathname, isContentClaim, isChannelClaim, authenticated); // Final answer: - const shouldLoadSticky = shouldShowAds && inAllowedPath && !gScript && !inIFrame() && !platform.isMobile(); + const shouldLoadSticky = shouldShowAds && !gScript && !inIFrame() && !platform.isMobile(); function shouldShowAdsForPath(pathname, isContentClaim, isChannelClaim, authenticated) { // $FlowIssue: mixed type