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
*/
"customFontSize": string;
/**
* Hide ads
*/
"hideAds": string;
}
declare const locales: {
[lang: string]: Locale;

View file

@ -110,7 +110,7 @@ export default defineComponent({
});
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);
if (isDebuggerEnabled(6864)) {

View file

@ -107,7 +107,7 @@ const chosen = ref(choseAd());
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 {
if (chosen.value == null) return;

View file

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

View file

@ -480,6 +480,9 @@ export const PREF_DEF = {
warnMissingAltText: {
default: true,
},
hideAds: {
default: false,
},
//#endregion
//#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"
customFontSize: "Custom font size"
hideAds: "Hide ads"