1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-07 14:46:38 +02:00

Don't generate code for Ads while snapping

This commit is contained in:
Phuoc Nguyen
2020-04-07 16:46:40 +07:00
parent a6c6d04243
commit 5074da62a9

View File

@@ -12,6 +12,10 @@ const Ad: React.FC<{}> = () => {
const source = 'https://cdn.carbonads.com/carbon.js?serve=CE7I6KQL&placement=csslayoutio'; const source = 'https://cdn.carbonads.com/carbon.js?serve=CE7I6KQL&placement=csslayoutio';
useEffect(() => { useEffect(() => {
// Ignore if the code is reached in snapping mode
if (navigator.userAgent === 'ReactSnap') {
return;
}
const container = containerRef.current; const container = containerRef.current;
if (!container) { if (!container) {
return; return;