fix: Read message appears on page refresh in the widget (#3175)
This commit is contained in:
parent
5799b9fa26
commit
5c30bc3e2b
2 changed files with 5 additions and 3 deletions
|
@ -36,6 +36,7 @@ export default {
|
|||
widgetPosition: 'right',
|
||||
showPopoutButton: false,
|
||||
isWebWidgetTriggered: false,
|
||||
isWidgetOpen: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -134,8 +135,8 @@ export default {
|
|||
this.hideMessageBubble = !!hideBubble;
|
||||
},
|
||||
registerUnreadEvents() {
|
||||
bus.$on('on-agent-message-recieved', () => {
|
||||
if (!this.isIFrame) {
|
||||
bus.$on('on-agent-message-received', () => {
|
||||
if (!this.isIFrame || this.isWidgetOpen) {
|
||||
this.setUserLastSeen();
|
||||
}
|
||||
this.setUnreadView();
|
||||
|
@ -257,6 +258,7 @@ export default {
|
|||
this.showUnreadView = false;
|
||||
this.showCampaignView = false;
|
||||
} else if (message.event === 'toggle-open') {
|
||||
this.isWidgetOpen = message.isOpen;
|
||||
this.toggleOpen();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@ class ActionCableConnector extends BaseActionCableConnector {
|
|||
this.app.$store
|
||||
.dispatch('conversation/addOrUpdateMessage', data)
|
||||
.then(() => {
|
||||
window.bus.$emit('on-agent-message-recieved');
|
||||
window.bus.$emit('on-agent-message-received');
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue