feat: Create campaign conversation only if user interacts with the bubble (#2335)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Muhsin Keloth 2021-06-15 20:09:42 +05:30 committed by GitHub
parent 853db60f8e
commit fb2f3ff89f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 211 additions and 18 deletions

View file

@ -156,6 +156,16 @@ export const IFrameHelper = {
}
},
setCampaignMode: () => {
const { isOpen } = window.$chatwoot;
const toggleValue = true;
if (!isOpen) {
onBubbleClick({ toggleValue });
const holderEl = document.querySelector('.woot-widget-holder');
addClass(holderEl, 'has-unread-view');
}
},
resetUnreadMode: () => {
IFrameHelper.sendMessage('unset-unread-view');
IFrameHelper.events.removeUnreadClass();