File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
packages/botonic-react/src/webchat/context Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -95,23 +95,21 @@ function updateMessageReducer(
95
95
const msgIndex = state . messagesJSON . map ( m => m . id ) . indexOf ( messageId )
96
96
if ( msgIndex > - 1 ) {
97
97
const msgComponent = state . messagesComponents [ msgIndex ]
98
+ let updatedMsgComponent = { }
98
99
if ( msgComponent ) {
99
- msgComponent . props = {
100
- ...msgComponent . props ,
101
- ack : action . payload . ack ,
100
+ updatedMsgComponent = {
101
+ ...msgComponent ,
102
+ ...{
103
+ props : { ...msgComponent . props , ack : action . payload . ack } ,
104
+ } ,
102
105
}
103
106
}
104
107
105
108
const updatedMessagesComponents = msgComponent
106
- ? getUpdatedMessagesComponents ( state , msgIndex , msgComponent )
109
+ ? getUpdatedMessagesComponents ( state , msgIndex , updatedMsgComponent )
107
110
: state . messagesComponents
108
111
109
112
const messageJSON = state . messagesJSON . find ( m => m . id === messageId )
110
- if ( messageJSON ) {
111
- messageJSON . data = {
112
- ...messageJSON . data ,
113
- }
114
- }
115
113
116
114
const updatedMessagesJSON = messageJSON
117
115
? getUpdatedMessagesJSON ( state , msgIndex , action . payload )
You can’t perform that action at this time.
0 commit comments