File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,13 +16,10 @@ export const adSlotConfig = {
1616 } ,
1717} ;
1818
19- export async function initializeAds ( adSlots : {
20- sidebar ?: string ;
21- grid ?: string ;
22- footer ?: string ;
23- } | null ) {
19+ export async function initializeAds ( ) {
2420 let adBlock = false ;
2521 let adsEnabled = true ;
22+ let adSlots : { sidebar : string ; grid : string ; footer : string } | null = null ;
2623 await detectAdBlockEnabled ( ) ;
2724 console . log (
2825 "[R][CardGrid][Mount] AdBlock Enabled:" ,
@@ -65,5 +62,5 @@ export async function initializeAds(adSlots: {
6562 } ) ( ) ;
6663 }
6764
68- return { adBlock, adsEnabled } ;
65+ return { adBlock, adsEnabled, adSlots } ;
6966}
Original file line number Diff line number Diff line change 1919 import { browser } from " $app/environment" ;
2020 import { loadGames } from " $lib/loadCards.js" ;
2121 import { goto } from " $app/navigation" ;
22- import { adSlotConfig , initializeAds } from " $lib/adSlotConfig.js" ;
22+ import { initializeAds } from " $lib/adSlotConfig.js" ;
2323
2424 let searchIsOpen = $state (false );
2525 let games = $state <Game []>([]);
244244
245245 if (SessionState .ssr ) return ;
246246
247- ({ adBlock , adsEnabled } = await initializeAds (adSlots ));
247+ ({ adBlock , adsEnabled , adSlots } = await initializeAds ());
248248 });
249249
250250 $effect (() => {
Original file line number Diff line number Diff line change 7474 let commitHash = $state (" " );
7575
7676 let adsEnabled = $state (false );
77+ let adBlock = $state (false );
7778 let adSlots = $state <{
7879 sidebar: string ;
7980 grid: string ;
109110 } else {
110111 (async () => {
111112 if (! browser ) return ;
112-
113- const hostname = window .location .hostname ;
114- const { adBlock, adsEnabled : adsOn } =
115- await initializeAds (
116- adSlots
117- );
118- adblock = adBlock ;
119- adsEnabled = adsOn ;
113+ ({ adBlock , adsEnabled , adSlots } = await initializeAds ());
120114 })();
121115 }
122116 });
Original file line number Diff line number Diff line change 1- 2025-10-17T06:17:09.059Z
1+ 2025-10-17T06:33:16.025Z
You can’t perform that action at this time.
0 commit comments