File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
samples/interactions/chat Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -105,15 +105,15 @@ igc-avatar::part(base) {
105
105
106
106
this . chat . options = { ...this . chat . options , isTyping : true , suggestions : [ ] } ;
107
107
const newMessage = e . detail ;
108
- this . messages . push ( newMessage ) ;
108
+ this . chat . messages = [ ... this . chat . messages , newMessage ] ;
109
109
110
110
const responseMessage = {
111
111
id : Date . now ( ) . toString ( ) ,
112
112
text : 'Our support team is currently unavailable. We\'ll get back to you as soon as possible.' ,
113
113
sender : 'support' ,
114
114
timestamp : Date . now ( ) . toString ( ) ,
115
115
} ;
116
- this . messages . push ( responseMessage ) ;
116
+ this . chat . messages = [ ... this . chat . messages , responseMessage ] ;
117
117
this . chat . draftMessage = { text : '' , attachments : [ ] } ;
118
118
this . chat . options = { ...this . chat . options , isTyping : false } ;
119
119
}
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export class ChatOverview {
83
83
public onMessageCreated = ( e : CustomEvent ) => {
84
84
e . preventDefault ( ) ;
85
85
const newMessage = e . detail ;
86
- this . messages . push ( newMessage ) ;
86
+ this . chat . messages = [ ... this . chat . messages , newMessage ] ;
87
87
this . chat . options = { ...this . chat . options , isTyping : true , suggestions : [ ] } ;
88
88
89
89
const messageText = e . detail . text . toLowerCase ( ) ;
@@ -99,7 +99,9 @@ export class ChatOverview {
99
99
sender : 'support' ,
100
100
timestamp : Date . now ( ) . toString ( ) ,
101
101
} ;
102
- this . messages . push ( responseMessage ) ;
102
+
103
+ this . chat . messages = [ ...this . chat . messages , responseMessage ] ;
104
+
103
105
this . chat . draftMessage = { text : '' , attachments : [ ] } ;
104
106
this . chat . options = { ...this . chat . options , isTyping : false } ;
105
107
}
You can’t perform that action at this time.
0 commit comments