feat: Add an SDK method for opening conversation in popout window (#4232)

This commit is contained in:
Fayaz Ahmed 2022-03-28 13:31:51 +05:30 committed by GitHub
parent 0ba6e772a4
commit 30ac8054ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 11 deletions

View file

@ -31,6 +31,7 @@ import {
initOnEvents,
} from 'shared/helpers/AudioNotificationHelper';
import { isFlatWidgetStyle } from './settingsHelper';
import { popoutChatWindow } from '../widget/helpers/popoutHelper';
export const IFrameHelper = {
getUrl({ baseUrl, websiteToken }) {
@ -190,6 +191,12 @@ export const IFrameHelper = {
onBubbleClick(bubbleState);
},
popoutChatWindow: ({ baseUrl, websiteToken, locale }) => {
const cwCookie = Cookies.get('cw_conversation');
window.$chatwoot.toggle('close');
popoutChatWindow(baseUrl, websiteToken, locale, cwCookie);
},
closeWindow: () => {
onBubbleClick({ toggleValue: false });
removeUnreadClass();