Redirect to messages after leaving a chat (#10861)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {Pressable} from 'react-native'
|
||||
import {Trans, useLingui} from '@lingui/react/macro'
|
||||
import {StackActions, useNavigation} from '@react-navigation/native'
|
||||
import {useNavigation} from '@react-navigation/native'
|
||||
|
||||
import {HITSLOP_10} from '#/lib/constants'
|
||||
import {type NavigationProp} from '#/lib/routes/types'
|
||||
@@ -34,8 +34,7 @@ export function ChatEnded({
|
||||
|
||||
const {mutate: leaveConvo} = useLeaveConvo(convo.view.id, {
|
||||
onSuccess: () => {
|
||||
// Settings > Chat > Chat list
|
||||
navigation.dispatch(StackActions.pop(2))
|
||||
navigation.replace('Messages', {animation: 'pop'})
|
||||
},
|
||||
onError: e => {
|
||||
logger.error('Failed to leave group chat', {message: e})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Pressable} from 'react-native'
|
||||
import {ChatBskyConvoUnlockConvo} from '@atproto/api'
|
||||
import {Trans, useLingui} from '@lingui/react/macro'
|
||||
import {StackActions, useNavigation} from '@react-navigation/native'
|
||||
import {useNavigation} from '@react-navigation/native'
|
||||
|
||||
import {HITSLOP_10} from '#/lib/constants'
|
||||
import {type NavigationProp} from '#/lib/routes/types'
|
||||
@@ -54,8 +54,7 @@ export function ChatLocked({
|
||||
|
||||
const {mutate: leaveConvo} = useLeaveConvo(convo.view.id, {
|
||||
onSuccess: () => {
|
||||
// Settings > Chat > Chat list
|
||||
navigation.dispatch(StackActions.pop(2))
|
||||
navigation.replace('Messages', {animation: 'pop'})
|
||||
},
|
||||
onError: e => {
|
||||
logger.error('Failed to leave group chat', {message: e})
|
||||
|
||||
Reference in New Issue
Block a user