@@ -65,6 +65,7 @@ export default function ViewProfile(props: {
65
65
const tx = window . static_translate
66
66
const { openDialog } = useContext ( ScreenContext )
67
67
const [ contact , setContact ] = useState < JsonContact > ( props . contact )
68
+ const isDeviceMessage = contact . id === C . DC_CONTACT_ID_DEVICE
68
69
69
70
const onClickEdit = ( ) => {
70
71
openDialog ( EditContactNameDialog , {
@@ -85,7 +86,7 @@ export default function ViewProfile(props: {
85
86
< DeltaDialogHeader
86
87
title = { tx ( 'menu_view_profile' ) }
87
88
onClickEdit = { onClickEdit }
88
- showEditButton = { true }
89
+ showEditButton = { ! isDeviceMessage }
89
90
showCloseButton = { true }
90
91
onClose = { onClose }
91
92
/>
@@ -109,6 +110,8 @@ export function ViewProfileInner({
109
110
const { isChatLoaded, loadChats, chatCache } = useLogicVirtualChatList (
110
111
chatListIds
111
112
)
113
+ const isDeviceMessage = contact . id === C . DC_CONTACT_ID_DEVICE
114
+
112
115
const tx = window . static_translate
113
116
114
117
const onChatClick = ( chatId : number ) => {
@@ -136,7 +139,9 @@ export function ViewProfileInner({
136
139
</ ClickForFullscreenAvatarWrapper >
137
140
< ProfileInfoName
138
141
name = { contact . displayName }
139
- address = { contact . address }
142
+ address = {
143
+ isDeviceMessage ? tx ( 'device_talk_subtitle' ) : contact . address
144
+ }
140
145
/>
141
146
</ div >
142
147
< div
@@ -146,7 +151,7 @@ export function ViewProfileInner({
146
151
justifyContent : 'center' ,
147
152
} }
148
153
>
149
- { contact . id !== C . DC_CONTACT_ID_DEVICE && (
154
+ { ! isDeviceMessage && (
150
155
< button
151
156
aria-label = { tx ( 'send_message' ) }
152
157
onClick = { onSendMessage }
@@ -175,35 +180,41 @@ export function ViewProfileInner({
175
180
</ div >
176
181
</ >
177
182
) }
178
- < DeltaDialogContentTextSeperator text = { tx ( 'profile_shared_chats' ) } />
179
- </ div >
180
- < div className = 'mutual-chats' style = { { flexGrow : 1 } } >
181
- < AutoSizer >
182
- { ( { width, height } ) => (
183
- < ChatListPart
184
- isRowLoaded = { isChatLoaded }
185
- loadMoreRows = { loadChats }
186
- rowCount = { chatListIds . length }
187
- width = { width }
188
- height = { height }
189
- itemKey = { index => 'key' + chatListIds [ index ] }
190
- itemHeight = { CHATLISTITEM_CHAT_HEIGHT }
191
- >
192
- { ( { index, style } ) => {
193
- const [ chatId ] = chatListIds [ index ]
194
- return (
195
- < div style = { style } >
196
- < ChatListItem
197
- chatListItem = { chatCache [ chatId ] || undefined }
198
- onClick = { onChatClick . bind ( null , chatId ) }
199
- />
200
- </ div >
201
- )
202
- } }
203
- </ ChatListPart >
204
- ) }
205
- </ AutoSizer >
206
183
</ div >
184
+ { ! isDeviceMessage && (
185
+ < >
186
+ < DeltaDialogContentTextSeperator
187
+ text = { tx ( 'profile_shared_chats' ) }
188
+ />
189
+ < div className = 'mutual-chats' style = { { flexGrow : 1 } } >
190
+ < AutoSizer >
191
+ { ( { width, height } ) => (
192
+ < ChatListPart
193
+ isRowLoaded = { isChatLoaded }
194
+ loadMoreRows = { loadChats }
195
+ rowCount = { chatListIds . length }
196
+ width = { width }
197
+ height = { height }
198
+ itemKey = { index => 'key' + chatListIds [ index ] }
199
+ itemHeight = { CHATLISTITEM_CHAT_HEIGHT }
200
+ >
201
+ { ( { index, style } ) => {
202
+ const [ chatId ] = chatListIds [ index ]
203
+ return (
204
+ < div style = { style } >
205
+ < ChatListItem
206
+ chatListItem = { chatCache [ chatId ] || undefined }
207
+ onClick = { onChatClick . bind ( null , chatId ) }
208
+ />
209
+ </ div >
210
+ )
211
+ } }
212
+ </ ChatListPart >
213
+ ) }
214
+ </ AutoSizer >
215
+ </ div >
216
+ </ >
217
+ ) }
207
218
</ div >
208
219
</ >
209
220
)
0 commit comments