[Chat] Improve gate (#10359)

This commit is contained in:
Samuel Newman
2026-04-24 16:48:57 +03:00
committed by GitHub
parent deb3f26d3e
commit e832791367
2 changed files with 33 additions and 11 deletions
+11 -6
View File
@@ -1,4 +1,4 @@
import {useCallback, useEffect, useMemo, useState} from 'react'
import {useCallback, useEffect, useMemo, useRef, useState} from 'react'
import {type LayoutChangeEvent, View} from 'react-native'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import {moderateProfile} from '@atproto/api'
@@ -319,7 +319,10 @@ function GroupChatGate() {
ax.features.GroupChatsHasBeenReleased,
)
const isAlreadyGoingBackRef = useRef(false)
const onGoBack = () => {
if (isAlreadyGoingBackRef.current) return
isAlreadyGoingBackRef.current = true
if (navigation.canGoBack()) {
navigation.goBack()
} else {
@@ -330,27 +333,29 @@ function GroupChatGate() {
return (
<Prompt.Outer
control={groupChatGateDialogControl}
onClose={onGoBack}
nativeOptions={{preventDismiss: true, preventExpansion: true}}
testID="groupChatGateDialog">
<Prompt.Content>
<View style={[a.w_full, a.align_center, a.py_2xl]}>
<Text style={{fontSize: 48}} emoji>
<View style={[a.w_full, a.align_center, a.py_3xl]}>
<Text style={{fontSize: 72}} emoji>
🐴
</Text>
</View>
<Prompt.TitleText>
<Prompt.TitleText style={[a.text_center]}>
{hasBeenReleased ? (
<Trans>Group chats are now available</Trans>
) : (
<Trans>Group chats are not yet available</Trans>
)}
</Prompt.TitleText>
<Prompt.DescriptionText>
<Prompt.DescriptionText style={[a.text_center]}>
{hasBeenReleased ? (
<Trans>Update your app to the latest version to join in!</Trans>
) : (
<Trans>
This feature isn't available to you yet. Please check back later.
Hold your horses! This feature isn't available to you yet. Please
check back later.
</Trans>
)}
</Prompt.DescriptionText>