Enhancement: Show unread marker on widget bubble (#3390)

* add unread marker

* add removeClass in IFramehelper

* Update app/javascript/sdk/sdk.js

* Update app/javascript/sdk/sdk.js

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
Sanju 2021-11-25 20:25:14 +05:30 committed by GitHub
parent b0370ce44d
commit 2c3c1888f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 0 deletions

View file

@ -200,12 +200,23 @@ export default {
unreadMessageCount,
});
this.setIframeHeight(this.isMobile);
this.handleUnreadNotificationDot();
}
},
unsetUnreadView() {
if (this.isIFrame) {
IFrameHelper.sendMessage({ event: 'resetUnreadMode' });
this.setIframeHeight();
this.handleUnreadNotificationDot();
}
},
handleUnreadNotificationDot() {
const { unreadMessageCount } = this;
if (this.isIFrame) {
IFrameHelper.sendMessage({
event: 'handleNotificationDot',
unreadMessageCount,
});
}
},
createWidgetEvents(message) {
@ -281,6 +292,7 @@ export default {
}
this.showUnreadView = false;
this.showCampaignView = false;
this.handleUnreadNotificationDot();
} else if (message.event === 'toggle-open') {
this.isWidgetOpen = message.isOpen;
this.toggleOpen();