Don't tell an account about 18+ when it hasn't got any

The child-profile checkbox read "Dětský profil (skryje anime a 18+, na
odchod chce PIN)" for everyone. Three of the four accounts are
nsfwEnabled = false, so for most of the household that sentence announced
a section they have never seen and cannot reach, and it was also untrue:
there is no 18+ content on those accounts to hide.

The adult source field on the Zdroje tab has always been gated on the same
flag. This label was the one place on the page that was not, because it was
static markup rather than something rendered from USER.

Now set in enter(): "skryje anime" alone, or "skryje anime a 18+" when the
account has it. Checked both branches against a clean and an adult test
user on a local instance.

The app is already clean here: childProfileDesc is only "K opuštění tohoto
profilu je potřeba PIN", and every 18+ string in app_cs.arb lives inside
the adult section itself, which a clean build does not contain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-08-12 22:04:36 +02:00
parent 79b615a02c
commit 874eab21dc

View file

@ -186,8 +186,9 @@
</select> </select>
<div class="check"> <div class="check">
<input id="pfChild" type="checkbox"> <input id="pfChild" type="checkbox">
<label for="pfChild" style="margin:0">Dětský profil (skryje anime a 18+, <!-- Text is set in enter(): an account without 18+ enabled must not be told
na odchod chce PIN)</label> that 18+ exists. See there. -->
<label for="pfChild" id="pfChildLabel" style="margin:0">Dětský profil</label>
</div> </div>
<label for="pfPin">Nový PIN (4 číslice, nech prázdné = beze změny)</label> <label for="pfPin">Nový PIN (4 číslice, nech prázdné = beze změny)</label>
<input id="pfPin" type="text" inputmode="numeric" maxlength="4" autocomplete="off"> <input id="pfPin" type="text" inputmode="numeric" maxlength="4" autocomplete="off">
@ -546,6 +547,16 @@ async function enter(){
loadProviders(), loadConfigList()]); loadProviders(), loadConfigList()]);
$("acEmail").value=(USER&&USER.email)||""; $("acEmail").value=(USER&&USER.email)||"";
$("acRating").value=(USER&&USER.ratingDefault)||"unrestricted"; $("acRating").value=(USER&&USER.ratingDefault)||"unrestricted";
// **Do not mention 18+ to an account that does not have it.** This label used to
// read "skryje anime a 18+" for everyone, which told most of the household that a
// section they have never seen and cannot reach exists at all. Three of the four
// accounts are `nsfwEnabled = false`, and for them the sentence was also simply
// untrue: there is no 18+ content to hide. The adult source field on the Zdroje
// tab has always been gated on the same flag; this label was the one place that
// was not.
$("pfChildLabel").textContent = (USER && USER.nsfwEnabled)
? "Dětský profil (skryje anime a 18+, na odchod chce PIN)"
: "Dětský profil (skryje anime, na odchod chce PIN)";
renderAddonGate(); renderAddonGate();
renderStart(); renderStart();
// An explicit #hash always wins — a bookmark or a link must land where it says. // An explicit #hash always wins — a bookmark or a link must land where it says.