fix: Read message appears on page refresh in the widget (#3175)

This commit is contained in:
Muhsin Keloth 2021-10-14 11:51:00 +05:30 committed by GitHub
parent 5799b9fa26
commit 5c30bc3e2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -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();
}
});

View file

@ -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');
});
};