about summary refs log tree commit diff
path: root/src/components/dms/LeaveConvoPrompt.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-01-22 21:03:31 +0000
committerGitHub <noreply@github.com>2025-01-22 21:03:31 +0000
commit74bb65714b7c7b128ddb27438773b149bbe5ec6c (patch)
tree83f3348e762938185977b74e51a10f96d4229bc3 /src/components/dms/LeaveConvoPrompt.tsx
parent638008c781d4ccb038de57344e18a5237a0f371d (diff)
downloadvoidsky-74bb65714b7c7b128ddb27438773b149bbe5ec6c.tar.zst
Post-report menu (#7446)
* post-report block/delete dialog

* fix

* default checked

* web styles

* add icon to send button

* wire everything up

* optimisically leave convo

* hide pending-leave convos

* Capitalize action labels

* Code style

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'src/components/dms/LeaveConvoPrompt.tsx')
-rw-r--r--src/components/dms/LeaveConvoPrompt.tsx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/components/dms/LeaveConvoPrompt.tsx b/src/components/dms/LeaveConvoPrompt.tsx
index cc18c1ab4..c99f8d063 100644
--- a/src/components/dms/LeaveConvoPrompt.tsx
+++ b/src/components/dms/LeaveConvoPrompt.tsx
@@ -1,6 +1,6 @@
 import {msg} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
-import {useNavigation} from '@react-navigation/native'
+import {StackActions, useNavigation} from '@react-navigation/native'
 
 import {NavigationProp} from '#/lib/routes/types'
 import {isNative} from '#/platform/detection'
@@ -22,15 +22,10 @@ export function LeaveConvoPrompt({
   const navigation = useNavigation<NavigationProp>()
 
   const {mutate: leaveConvo} = useLeaveConvo(convoId, {
-    onSuccess: () => {
+    onMutate: () => {
       if (currentScreen === 'conversation') {
-        navigation.replace(
-          'Messages',
-          isNative
-            ? {
-                animation: 'pop',
-              }
-            : {},
+        navigation.dispatch(
+          StackActions.replace('Messages', isNative ? {animation: 'pop'} : {}),
         )
       }
     },