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

Configure Feed

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

fix boooleans

+18 -2
+18 -2
src/lib/api/ozone.ts
··· 39 39 40 40 export function getAdsDefault() { 41 41 const adsDefault = env.PUBLIC_ENABLE_ADS_DEFAULT as string | boolean | undefined 42 - return adsDefault === 'true' || adsDefault === true 42 + return resolveBoolean(adsDefault, false) 43 43 } 44 44 45 45 export function getAllowSelfLogin() { 46 46 const allowSelfLogin = env.PUBLIC_ALLOW_SELF_LOGIN as string | boolean | undefined 47 - return allowSelfLogin === 'true' || allowSelfLogin === true 47 + return resolveBoolean(allowSelfLogin, false) 48 + } 49 + 50 + function resolveBoolean(value: string | boolean | undefined, defaultValue: boolean): boolean { 51 + if (value === undefined) { 52 + return defaultValue 53 + } 54 + if (typeof value === 'string' && (value === '0' || value === '1')) { 55 + return value === '1' 56 + } 57 + if (typeof value === 'boolean') { 58 + return value 59 + } 60 + if (typeof value === 'string') { 61 + return value.toLowerCase() === 'true' 62 + } 63 + return defaultValue 48 64 }