Bluesky app fork with some witchin' additions 💫

Fix broken error screen in DMs (#8071)

authored by samuel.fm and committed by

GitHub 07d667db a9675b37

+18 -9
+18 -9
src/screens/Messages/Conversation.tsx
··· 1 1 import React, {useCallback} from 'react' 2 2 import {View} from 'react-native' 3 3 import { 4 - AppBskyActorDefs, 4 + type AppBskyActorDefs, 5 5 moderateProfile, 6 - ModerationDecision, 6 + type ModerationDecision, 7 7 } from '@atproto/api' 8 8 import {msg} from '@lingui/macro' 9 9 import {useLingui} from '@lingui/react' 10 10 import { 11 - RouteProp, 11 + type RouteProp, 12 12 useFocusEffect, 13 13 useNavigation, 14 14 useRoute, 15 15 } from '@react-navigation/native' 16 - import {NativeStackScreenProps} from '@react-navigation/native-stack' 16 + import {type NativeStackScreenProps} from '@react-navigation/native-stack' 17 17 18 18 import {useEmail} from '#/lib/hooks/useEmail' 19 19 import {useEnableKeyboardControllerScreen} from '#/lib/hooks/useEnableKeyboardController' 20 - import {CommonNavigatorParams, NavigationProp} from '#/lib/routes/types' 20 + import { 21 + type CommonNavigatorParams, 22 + type NavigationProp, 23 + } from '#/lib/routes/types' 21 24 import {isWeb} from '#/platform/detection' 22 - import {Shadow, useMaybeProfileShadow} from '#/state/cache/profile-shadow' 25 + import {type Shadow, useMaybeProfileShadow} from '#/state/cache/profile-shadow' 23 26 import {ConvoProvider, isConvoActive, useConvo} from '#/state/messages/convo' 24 27 import {ConvoStatus} from '#/state/messages/convo/types' 25 28 import {useCurrentConvoId} from '#/state/messages/current-convo-id' ··· 111 114 112 115 if (convoState.status === ConvoStatus.Error) { 113 116 return ( 114 - <Layout.Center style={[a.flex_1]}> 115 - <MessagesListHeader /> 117 + <> 118 + <Layout.Center style={[a.flex_1]}> 119 + {moderation ? ( 120 + <MessagesListHeader moderation={moderation} profile={recipient} /> 121 + ) : ( 122 + <MessagesListHeader /> 123 + )} 124 + </Layout.Center> 116 125 <Error 117 126 title={_(msg`Something went wrong`)} 118 127 message={_(msg`We couldn't load this conversation`)} 119 128 onRetry={() => convoState.error.retry()} 120 129 sideBorders={false} 121 130 /> 122 - </Layout.Center> 131 + </> 123 132 ) 124 133 } 125 134