From dc62ce2fb0bb0b2f176bce38476b4e7960b26748 Mon Sep 17 00:00:00 2001 From: surfdude29 <149612116+surfdude29@users.noreply.github.com> Date: Tue, 26 May 2026 16:51:48 +0100 Subject: [PATCH] Fix "under 18" admonition being incorrectly shown on Moderation screen (#10521) Co-authored-by: Claude Co-authored-by: Eric Bailey --- src/ageAssurance/index.tsx | 7 +++++-- src/screens/Moderation/index.tsx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ageAssurance/index.tsx b/src/ageAssurance/index.tsx index c64492eff6..a5cca327ae 100644 --- a/src/ageAssurance/index.tsx +++ b/src/ageAssurance/index.tsx @@ -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}) { { 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, }, diff --git a/src/screens/Moderation/index.tsx b/src/screens/Moderation/index.tsx index 5bd36e3374..9aea34b89d 100644 --- a/src/screens/Moderation/index.tsx +++ b/src/screens/Moderation/index.tsx @@ -225,7 +225,7 @@ export function ModerationScreenInner({ return ( - {aa.flags.adultContentDisabled && isBirthdateUpdateAllowed && ( + {aa.flags.isDeclaredUnderAdultAge && isBirthdateUpdateAllowed && (