about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-04-01 17:22:59 +0300
committerGitHub <noreply@github.com>2025-04-01 17:22:59 +0300
commit07d667dba8a68d73f81d682193d1558daa5d5f15 (patch)
tree48874ff85f327dff1cd8c15ea148964b6f27bfb9
parenta9675b372e861b3a60987b0c7ef9183bba9c1af8 (diff)
downloadvoidsky-07d667dba8a68d73f81d682193d1558daa5d5f15.tar.zst
Fix broken error screen in DMs (#8071)
-rw-r--r--src/screens/Messages/Conversation.tsx27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/screens/Messages/Conversation.tsx b/src/screens/Messages/Conversation.tsx
index cac5ff157..2222084ce 100644
--- a/src/screens/Messages/Conversation.tsx
+++ b/src/screens/Messages/Conversation.tsx
@@ -1,25 +1,28 @@
 import React, {useCallback} from 'react'
 import {View} from 'react-native'
 import {
-  AppBskyActorDefs,
+  type AppBskyActorDefs,
   moderateProfile,
-  ModerationDecision,
+  type ModerationDecision,
 } from '@atproto/api'
 import {msg} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
 import {
-  RouteProp,
+  type RouteProp,
   useFocusEffect,
   useNavigation,
   useRoute,
 } from '@react-navigation/native'
-import {NativeStackScreenProps} from '@react-navigation/native-stack'
+import {type NativeStackScreenProps} from '@react-navigation/native-stack'
 
 import {useEmail} from '#/lib/hooks/useEmail'
 import {useEnableKeyboardControllerScreen} from '#/lib/hooks/useEnableKeyboardController'
-import {CommonNavigatorParams, NavigationProp} from '#/lib/routes/types'
+import {
+  type CommonNavigatorParams,
+  type NavigationProp,
+} from '#/lib/routes/types'
 import {isWeb} from '#/platform/detection'
-import {Shadow, useMaybeProfileShadow} from '#/state/cache/profile-shadow'
+import {type Shadow, useMaybeProfileShadow} from '#/state/cache/profile-shadow'
 import {ConvoProvider, isConvoActive, useConvo} from '#/state/messages/convo'
 import {ConvoStatus} from '#/state/messages/convo/types'
 import {useCurrentConvoId} from '#/state/messages/current-convo-id'
@@ -111,15 +114,21 @@ function Inner() {
 
   if (convoState.status === ConvoStatus.Error) {
     return (
-      <Layout.Center style={[a.flex_1]}>
-        <MessagesListHeader />
+      <>
+        <Layout.Center style={[a.flex_1]}>
+          {moderation ? (
+            <MessagesListHeader moderation={moderation} profile={recipient} />
+          ) : (
+            <MessagesListHeader />
+          )}
+        </Layout.Center>
         <Error
           title={_(msg`Something went wrong`)}
           message={_(msg`We couldn't load this conversation`)}
           onRetry={() => convoState.error.retry()}
           sideBorders={false}
         />
-      </Layout.Center>
+      </>
     )
   }