Fix "under 18" admonition being incorrectly shown on Moderation screen (#10521)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
surfdude29
2026-05-26 16:51:48 +01:00
committed by GitHub
parent 68431182ef
commit dc62ce2fb0
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -41,6 +41,7 @@ const AgeAssuranceStateContext = createContext<{
flags: {
adultContentDisabled: boolean
chatDisabled: boolean
isDeclaredUnderAdultAge: boolean
isOverRegionMinAccessAge: boolean
isOverAppMinAccessAge: boolean
}
@@ -55,6 +56,7 @@ const AgeAssuranceStateContext = createContext<{
flags: {
adultContentDisabled: false,
chatDisabled: false,
isDeclaredUnderAdultAge: false,
isOverRegionMinAccessAge: false,
isOverAppMinAccessAge: false,
},
@@ -106,7 +108,7 @@ function InnerProvider({children}: {children: React.ReactNode}) {
<AgeAssuranceStateContext.Provider
value={useMemo(() => {
const chatDisabled = state.access !== AgeAssuranceAccess.Full
const isUnderAdultAge = data?.birthdate
const isDeclaredUnderAdultAge = data?.birthdate
? isUnderAge(data.birthdate, 18)
: true
const isOverRegionMinAccessAge = data?.birthdate
@@ -116,7 +118,7 @@ function InnerProvider({children}: {children: React.ReactNode}) {
? !isUnderAge(data.birthdate, MIN_ACCESS_AGE)
: false
const adultContentDisabled =
state.access !== AgeAssuranceAccess.Full || isUnderAdultAge
state.access !== AgeAssuranceAccess.Full || isDeclaredUnderAdultAge
return {
Access: AgeAssuranceAccess,
Status: AgeAssuranceStatus,
@@ -124,6 +126,7 @@ function InnerProvider({children}: {children: React.ReactNode}) {
flags: {
adultContentDisabled,
chatDisabled,
isDeclaredUnderAdultAge,
isOverRegionMinAccessAge,
isOverAppMinAccessAge,
},
+1 -1
View File
@@ -225,7 +225,7 @@ export function ModerationScreenInner({
return (
<View style={[a.pt_2xl, a.px_lg, gtMobile && a.px_2xl]}>
{aa.flags.adultContentDisabled && isBirthdateUpdateAllowed && (
{aa.flags.isDeclaredUnderAdultAge && isBirthdateUpdateAllowed && (
<View style={[a.pb_2xl]}>
<Admonition.Admonition type="tip" style={[a.pb_md]}>
<Trans>