Adds unread message bubbles for widget (#943)
Co-authored-by: Sojan <sojan@pepalo.com> Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
committed by
GitHub
parent
6a7d810c95
commit
49db9c5d8a
@@ -31,13 +31,17 @@ export const createNotificationBubble = () => {
|
||||
return notificationBubble;
|
||||
};
|
||||
|
||||
export const onBubbleClick = () => {
|
||||
window.$chatwoot.isOpen = !window.$chatwoot.isOpen;
|
||||
toggleClass(chatBubble, 'woot--hide');
|
||||
toggleClass(closeBubble, 'woot--hide');
|
||||
toggleClass(widgetHolder, 'woot--hide');
|
||||
if (window.$chatwoot.isOpen) {
|
||||
IFrameHelper.pushEvent('webwidget.triggered');
|
||||
export const onBubbleClick = (props = {}) => {
|
||||
const { toggleValue } = props;
|
||||
const { isOpen } = window.$chatwoot;
|
||||
if (isOpen !== toggleValue) {
|
||||
const newIsOpen = toggleValue === undefined ? !isOpen : toggleValue;
|
||||
window.$chatwoot.isOpen = newIsOpen;
|
||||
|
||||
toggleClass(chatBubble, 'woot--hide');
|
||||
toggleClass(closeBubble, 'woot--hide');
|
||||
toggleClass(widgetHolder, 'woot--hide');
|
||||
IFrameHelper.events.onBubbleToggle(newIsOpen);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user