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:
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user