From 07d667dba8a68d73f81d682193d1558daa5d5f15 Mon Sep 17 00:00:00 2001
From: Samuel Newman <mozzius@protonmail.com>
Date: Tue, 1 Apr 2025 17:22:59 +0300
Subject: Fix broken error screen in DMs (#8071)

---
 src/screens/Messages/Conversation.tsx | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

(limited to 'src/screens/Messages/Conversation.tsx')

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>
+      </>
     )
   }
 
-- 
cgit 1.4.1

