fix: Disable showing read messages in unread view (#4324)

This commit is contained in:
Muhsin Keloth
2022-03-31 17:35:39 +05:30
committed by GitHub
parent 0477123f92
commit eff3a50316
5 changed files with 47 additions and 26 deletions

View File

@@ -138,7 +138,13 @@ export default {
}
},
registerUnreadEvents() {
bus.$on(ON_AGENT_MESSAGE_RECEIVED, this.setUnreadView);
bus.$on(ON_AGENT_MESSAGE_RECEIVED, () => {
const { name: routeName } = this.$route;
if (this.isWidgetOpen && routeName === 'messages') {
this.$store.dispatch('conversation/setUserLastSeen');
}
this.setUnreadView();
});
bus.$on(ON_UNREAD_MESSAGE_CLICK, () => {
this.replaceRoute('messages').then(() => this.unsetUnreadView());
});
@@ -175,6 +181,7 @@ export default {
},
setUnreadView() {
const { unreadMessageCount } = this;
if (this.isIFrame && unreadMessageCount > 0 && !this.isWidgetOpen) {
this.replaceRoute('unread-messages').then(() => {
this.setIframeHeight(true);