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
+7 -3
View File
@@ -49,6 +49,7 @@ import {
Message_Stroke2_Corner0_Rounded_Filled as MessageFilled,
} from '#/components/icons/Message'
import {Text} from '#/components/Typography'
import {useAgeAssurance} from '#/ageAssurance'
import {useActorStatus} from '#/features/liveNow'
import {useDemoMode} from '#/storage/hooks/demo-mode'
import {styles} from './BottomBarStyles'
@@ -65,6 +66,7 @@ export function BottomBar({navigation}: BottomTabBarProps) {
useNavigationTabState()
const numUnreadNotifications = useUnreadNotifications()
const numUnreadMessages = useUnreadMessageCount()
const aa = useAgeAssurance()
const footerMinimalShellTransform = useMinimalShellFooterTransform()
const {data: profile} = useProfileQuery({did: currentAccount?.did})
const {requestSwitchToAccount} = useLoggedOutViewControls()
@@ -213,13 +215,15 @@ export function BottomBar({navigation}: BottomTabBarProps) {
)
}
onPress={onPressMessages}
notificationCount={numUnreadMessages.numUnread}
hasNew={numUnreadMessages.hasNew}
notificationCount={
aa.flags.chatDisabled ? undefined : numUnreadMessages.numUnread
}
hasNew={aa.flags.chatDisabled ? false : numUnreadMessages.hasNew}
accessible={true}
accessibilityRole="tab"
accessibilityLabel={_(msg`Chat`)}
accessibilityHint={
numUnreadMessages.count > 0
!aa.flags.chatDisabled && numUnreadMessages.count > 0
? _(
plural(numUnreadMessages.numUnread ?? 0, {
one: '# unread item',
+10 -2
View File
@@ -43,6 +43,7 @@ import {
Message_Stroke2_Corner0_Rounded_Filled as MessageFilled,
} from '#/components/icons/Message'
import {Text} from '#/components/Typography'
import {useAgeAssurance} from '#/ageAssurance'
import {styles} from './BottomBarStyles'
export function BottomBarWeb() {
@@ -60,6 +61,7 @@ export function BottomBarWeb() {
const unreadMessageCount = useUnreadMessageCount()
const notificationCountStr = useUnreadNotifications()
const aa = useAgeAssurance()
const showSignIn = useCallback(() => {
closeAllActiveElements()
@@ -124,8 +126,14 @@ export function BottomBarWeb() {
<NavItem
routeName="Messages"
href="/messages"
notificationCount={unreadMessageCount.numUnread}
hasNew={unreadMessageCount.hasNew}>
notificationCount={
aa.flags.chatDisabled
? undefined
: unreadMessageCount.numUnread
}
hasNew={
aa.flags.chatDisabled ? false : unreadMessageCount.hasNew
}>
{({isActive}) => {
const Icon = isActive ? MessageFilled : Message
return (