@@ -150,24 +150,9 @@ const MessageOverlayWithContext = <
150150
151151 const { theme } = useTheme ( ) ;
152152
153- const {
154- colors : {
155- blue_alice,
156- grey_gainsboro,
157- grey_whisper,
158- transparent,
159- white_smoke,
160- } ,
161- messageSimple : {
162- content : {
163- container : { borderRadiusL, borderRadiusS } ,
164- containerInner,
165- replyContainer,
166- } ,
167- } ,
168- } = theme ;
169-
170153 const myMessageTheme = messagesContext ?. myMessageTheme ;
154+ const wrapMessageInTheme = clientId === message ?. user ?. id && ! ! myMessageTheme ;
155+
171156 const [ myMessageThemeString , setMyMessageThemeString ] = useState (
172157 JSON . stringify ( myMessageTheme ) ,
173158 ) ;
@@ -183,6 +168,23 @@ const MessageOverlayWithContext = <
183168 [ myMessageThemeString , theme ] ,
184169 ) ;
185170
171+ const {
172+ colors : {
173+ blue_alice,
174+ grey_gainsboro,
175+ grey_whisper,
176+ transparent,
177+ white_smoke,
178+ } ,
179+ messageSimple : {
180+ content : {
181+ container : { borderRadiusL, borderRadiusS } ,
182+ containerInner,
183+ replyContainer,
184+ } ,
185+ } ,
186+ } = wrapMessageInTheme ? modifiedTheme : theme ;
187+
186188 const scrollViewRef = useRef < ScrollView > ( null ) ;
187189
188190 const messageHeight = useSharedValue ( 0 ) ;
@@ -334,8 +336,6 @@ const MessageOverlayWithContext = <
334336 const { Attachment, FileAttachmentGroup, Gallery, MessageAvatar, Reply } =
335337 messagesContext || { } ;
336338
337- const wrapMessageInTheme = clientId === message ?. user ?. id && ! ! myMessageTheme ;
338-
339339 return (
340340 < MessagesProvider < At , Ch , Co , Ev , Me , Re , Us > value = { messagesContext } >
341341 < ThemeProvider mergedStyle = { wrapMessageInTheme ? modifiedTheme : theme } >
0 commit comments