beatufitull front end for ozone modration ,, wit catpucoin and ebergarden !
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

wait more ads

+28
+28
src/lib/ads.ts
··· 1 + import { writable } from 'svelte/store'; 2 + 3 + function createAdsStore() { 4 + const { subscribe, set } = writable<boolean>(false); 5 + 6 + function update() { 7 + set(!localStorage.getItem('adDismissed')); 8 + } 9 + 10 + function toggle(enabled: boolean) { 11 + if (enabled) { 12 + localStorage.removeItem('adDismissed'); 13 + } else { 14 + localStorage.setItem('adDismissed', 'true'); 15 + } 16 + 17 + update(); 18 + } 19 + 20 + if (typeof window !== 'undefined') { 21 + update(); 22 + window.addEventListener('storage', update); 23 + } 24 + 25 + return { subscribe, toggle }; 26 + } 27 + 28 + export const ads = createAdsStore();