Skip to content

Commit 1805cac

Browse files
committed
fix: simplify ad hide button logic and improve error handling for ad loading
1 parent 652a807 commit 1805cac

File tree

1 file changed

+5
-8
lines changed
  • apps/frontend/src/modules/shared/components/client/ads

1 file changed

+5
-8
lines changed

apps/frontend/src/modules/shared/components/client/ads/AdSlots.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ const HideAdButton = ({
1818
<button
1919
className='h-6 w-3'
2020
onClick={() => {
21-
(setIsHidden(true),
22-
setTimeout(
23-
() => {
24-
setIsHidden(false);
25-
},
26-
1000 * 60 * 5,
27-
)); // Reappers after 5 minutes
21+
setIsHidden(true);
22+
setTimeout(() => {
23+
setIsHidden(false);
24+
}, 1000 * 60 * 5); // Reappears after 5 minutes
2825
}}
2926
>
3027
<FontAwesomeIcon
@@ -62,7 +59,7 @@ const AdTemplate = ({
6259
try {
6360
(window.adsbygoogle = window.adsbygoogle || []).push({});
6461
} catch (e) {
65-
console.error(e);
62+
// Silently handle ad loading errors
6663
}
6764
}
6865
}, []);

0 commit comments

Comments
 (0)