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.

add disable ads by default ,, if u didnt liek dem :c

+13 -3
+2 -1
.env.example
··· 1 1 PUBLIC_LABELER_DID="did:plc:example" 2 2 PUBLIC_LABELER_URL="https://..." 3 3 PUBLIC_PDS_URL="https://..." 4 - PUBLIC_AUTHENTICATION="oauth" # either "oauth" or "password" 4 + PUBLIC_AUTHENTICATION="oauth" # either "oauth" or "password" 5 + PUBLIC_ENABLE_ADS_DEFAULT=true
-1
src/components/Advertisement.svelte
··· 1 1 <script lang="ts"> 2 2 import { XIcon } from 'lucide-svelte'; 3 - import { onMount } from 'svelte'; 4 3 import { ads } from '$lib/ads'; 5 4 6 5 const { className } = $props<{
+6 -1
src/lib/ads.ts
··· 1 1 import { writable } from 'svelte/store'; 2 + import { getAdsDefault } from './api/ozone'; 2 3 3 4 function createAdsStore() { 4 5 const { subscribe, set } = writable<boolean>(false); 5 6 6 7 function update() { 7 - set(!localStorage.getItem('adDismissed')); 8 + const dismissed = localStorage.getItem('adDismissed') === 'true'; 9 + if (!dismissed && !getAdsDefault()) { 10 + return set(false); 11 + } 12 + set(!dismissed); 8 13 } 9 14 10 15 function toggle(enabled: boolean) {
+5
src/lib/api/ozone.ts
··· 35 35 throw new Error('Invalid authentication method. Set PUBLIC_AUTHENTICATION to either "oauth" or "password".') 36 36 } 37 37 return authMethod 38 + } 39 + 40 + export function getAdsDefault() { 41 + const adsDefault = env.PUBLIC_ENABLE_ADS_DEFAULT as string | boolean | undefined 42 + return adsDefault === 'true' || adsDefault === true 38 43 }