Don't show chat notification if viewer is age gated (#10042)

This commit is contained in:
DS Boyce
2026-03-12 11:21:57 -07:00
committed by GitHub
parent 7b5d5a4f76
commit 9c9970f680
4 changed files with 27 additions and 11 deletions
+6 -4
View File
@@ -74,6 +74,7 @@ import {CENTER_COLUMN_OFFSET} from '#/components/Layout'
import * as Menu from '#/components/Menu'
import * as Prompt from '#/components/Prompt'
import {Text} from '#/components/Typography'
import {useAgeAssurance} from '#/ageAssurance'
import {useActorStatus} from '#/features/liveNow'
import {PlatformInfo} from '../../../../modules/expo-bluesky-swiss-army'
import {router} from '../../../routes'
@@ -349,7 +350,7 @@ function SwitchMenuItem({
'@',
)}`,
)}
onPress={() => onPressSwitchAccount(account, 'SwitchAccount')}>
onPress={() => void onPressSwitchAccount(account, 'SwitchAccount')}>
<View>
<UserAvatar
avatar={profile?.avatar}
@@ -572,7 +573,7 @@ function ComposeBtn() {
<Button
disabled={isFetchingHandle}
label={_(msg`Compose new post`)}
onPress={onPressCompose}
onPress={() => void onPressCompose()}
size="large"
variant="solid"
color="primary"
@@ -590,12 +591,13 @@ function ChatNavItem() {
const pal = usePalette('default')
const {_} = useLingui()
const numUnreadMessages = useUnreadMessageCount()
const aa = useAgeAssurance()
return (
<NavItem
href="/messages"
count={numUnreadMessages.numUnread}
hasNew={numUnreadMessages.hasNew}
count={aa.flags.chatDisabled ? undefined : numUnreadMessages.numUnread}
hasNew={aa.flags.chatDisabled ? false : numUnreadMessages.hasNew}
icon={
<Message style={pal.text} aria-hidden={true} width={NAV_ICON_WIDTH} />
}