Don't show chat notification if viewer is age gated (#10042)
This commit is contained in:
@@ -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} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user