replace confusing "always show ads" setting with "hide ads"

This commit is contained in:
Hazelnoot 2025-06-20 16:40:13 -04:00
parent 57450fd8b8
commit b6b87b320e
6 changed files with 16 additions and 6 deletions

4
locales/index.d.ts vendored
View file

@ -13403,6 +13403,10 @@ export interface Locale extends ILocale {
* Custom font size * Custom font size
*/ */
"customFontSize": string; "customFontSize": string;
/**
* Hide ads
*/
"hideAds": string;
} }
declare const locales: { declare const locales: {
[lang: string]: Locale; [lang: string]: Locale;

View file

@ -110,7 +110,7 @@ export default defineComponent({
}); });
const renderChildren = () => { const renderChildren = () => {
const shouldHideAds = (!prefer.s.forceShowAds && $i && $i.policies.canHideAds) ?? false; const shouldHideAds = prefer.s.hideAds && $i != null && $i.policies.canHideAds;
const children = renderChildrenImpl(shouldHideAds); const children = renderChildrenImpl(shouldHideAds);
if (isDebuggerEnabled(6864)) { if (isDebuggerEnabled(6864)) {

View file

@ -107,7 +107,7 @@ const chosen = ref(choseAd());
const self = computed(() => chosen.value?.url.startsWith(local)); const self = computed(() => chosen.value?.url.startsWith(local));
const shouldHide = ref(!prefer.s.forceShowAds && $i && $i.policies.canHideAds && (props.specify == null)); const shouldHide = computed(() => prefer.s.hideAds && $i != null && $i.policies.canHideAds && (props.specify == null));
function reduceFrequency(): void { function reduceFrequency(): void {
if (chosen.value == null) return; if (chosen.value == null) return;

View file

@ -913,10 +913,10 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkFolder> </MkFolder>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['ad', 'show']"> <SearchMarker v-if="$i.policies.canHideAds" :keywords="['ad', 'hide']">
<MkPreferenceContainer k="forceShowAds"> <MkPreferenceContainer k="hideAds">
<MkSwitch v-model="forceShowAds"> <MkSwitch v-model="hideAds">
<template #label><SearchLabel>{{ i18n.ts.forceShowAds }}</SearchLabel></template> <template #label><SearchLabel>{{ i18n.ts.hideAds }}</SearchLabel></template>
</MkSwitch> </MkSwitch>
</MkPreferenceContainer> </MkPreferenceContainer>
</SearchMarker> </SearchMarker>
@ -1096,6 +1096,7 @@ const trustedDomains = prefer.model(
(domainsList) => domainsList.join('\n'), (domainsList) => domainsList.join('\n'),
(domainsString) => domainsString.split('\n').map( d => d.trim() ).filter( x => x.length > 0), (domainsString) => domainsString.split('\n').map( d => d.trim() ).filter( x => x.length > 0),
); );
const hideAds = prefer.model('hideAds');
watch([ watch([
hemisphere, hemisphere,

View file

@ -480,6 +480,9 @@ export const PREF_DEF = {
warnMissingAltText: { warnMissingAltText: {
default: true, default: true,
}, },
hideAds: {
default: false,
},
//#endregion //#endregion
//#region hybrid options //#region hybrid options

View file

@ -661,3 +661,5 @@ clearCachedFilesOptions:
keepFilesInUseDescription: "this option requires more complicated database queries, you may need to increase the value of db.extra.statement_timeout in the configuration file" keepFilesInUseDescription: "this option requires more complicated database queries, you may need to increase the value of db.extra.statement_timeout in the configuration file"
customFontSize: "Custom font size" customFontSize: "Custom font size"
hideAds: "Hide ads"