From 32b28d666229ac24cf7b1ac328d1566fb089e1a1 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Mon, 3 Feb 2025 14:37:24 -0800 Subject: Fix convo header loading state (#7603) * get initial convo state from cache * undo useConvoQuery changes * fix shadowing situation with new hook --- src/components/dms/ConvoMenu.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/components/dms/ConvoMenu.tsx') 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 && ( - markAsRead({ - convoId: convo?.id, - }) - }> + onPress={() => markAsRead({convoId})}> Mark as read @@ -222,7 +219,7 @@ let ConvoMenu = ({ {latestReportableMessage ? ( @@ -230,7 +227,7 @@ let ConvoMenu = ({ currentScreen={currentScreen} params={{ type: 'convoMessage', - convoId: convo.id, + convoId: convoId, message: latestReportableMessage, }} control={reportControl} -- cgit 1.4.1