about summary refs log tree commit diff
path: root/src/components/dms/ConvoMenu.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-02-03 14:37:24 -0800
committerGitHub <noreply@github.com>2025-02-03 22:37:24 +0000
commit32b28d666229ac24cf7b1ac328d1566fb089e1a1 (patch)
tree2e721117c9a859ca1cae52e1c15642d5e6db4d5b /src/components/dms/ConvoMenu.tsx
parentfa8607b861e0719d76778aa14af0745313640e33 (diff)
downloadvoidsky-32b28d666229ac24cf7b1ac328d1566fb089e1a1.tar.zst
Fix convo header loading state (#7603)
* get initial convo state from cache

* undo useConvoQuery changes

* fix shadowing situation with new hook
Diffstat (limited to 'src/components/dms/ConvoMenu.tsx')
-rw-r--r--src/components/dms/ConvoMenu.tsx13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/components/dms/ConvoMenu.tsx b/src/components/dms/ConvoMenu.tsx
index 5b4b68149..29b6aeab1 100644
--- a/src/components/dms/ConvoMenu.tsx
+++ b/src/components/dms/ConvoMenu.tsx
@@ -73,13 +73,14 @@ let ConvoMenu = ({
   const isBlocking = userBlock || !!listBlocks.length
   const isDeletedAccount = profile.handle === 'missing.invalid'
 
+  const convoId = initialConvo.id
   const {data: convo} = useConvoQuery(initialConvo)
 
   const onNavigateToProfile = useCallback(() => {
     navigation.navigate('Profile', {name: profile.did})
   }, [navigation, profile.did])
 
-  const {mutate: muteConvo} = useMuteConvo(convo?.id, {
+  const {mutate: muteConvo} = useMuteConvo(convoId, {
     onSuccess: data => {
       if (data.convo.muted) {
         Toast.show(_(msg`Chat muted`))
@@ -152,11 +153,7 @@ let ConvoMenu = ({
               {showMarkAsRead && (
                 <Menu.Item
                   label={_(msg`Mark as read`)}
-                  onPress={() =>
-                    markAsRead({
-                      convoId: convo?.id,
-                    })
-                  }>
+                  onPress={() => markAsRead({convoId})}>
                   <Menu.ItemText>
                     <Trans>Mark as read</Trans>
                   </Menu.ItemText>
@@ -222,7 +219,7 @@ let ConvoMenu = ({
 
       <LeaveConvoPrompt
         control={leaveConvoControl}
-        convoId={convo.id}
+        convoId={convoId}
         currentScreen={currentScreen}
       />
       {latestReportableMessage ? (
@@ -230,7 +227,7 @@ let ConvoMenu = ({
           currentScreen={currentScreen}
           params={{
             type: 'convoMessage',
-            convoId: convo.id,
+            convoId: convoId,
             message: latestReportableMessage,
           }}
           control={reportControl}