From 5074da62a9683d377b56101667b5b7d97ff4ae4c Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Tue, 7 Apr 2020 16:46:40 +0700 Subject: [PATCH] Don't generate code for Ads while snapping --- client/components/Ad.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/components/Ad.tsx b/client/components/Ad.tsx index 4d99ce7..b03ea60 100644 --- a/client/components/Ad.tsx +++ b/client/components/Ad.tsx @@ -12,6 +12,10 @@ const Ad: React.FC<{}> = () => { const source = 'https://cdn.carbonads.com/carbon.js?serve=CE7I6KQL&placement=csslayoutio'; useEffect(() => { + // Ignore if the code is reached in snapping mode + if (navigator.userAgent === 'ReactSnap') { + return; + } const container = containerRef.current; if (!container) { return;