mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-31 19:17:48 +00:00
feat: Add an option to listen to the start conversation click events (#8038)
This PR will add a new event chatwoot:on-start-conversation to the chat widget, which you can listen to and trigger custom interactions on your end. Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -23,11 +23,7 @@ import {
|
||||
} from './bubbleHelpers';
|
||||
import { isWidgetColorLighter } from 'shared/helpers/colorHelper';
|
||||
import { dispatchWindowEvent } from 'shared/helpers/CustomEventHelper';
|
||||
import {
|
||||
CHATWOOT_ERROR,
|
||||
CHATWOOT_ON_MESSAGE,
|
||||
CHATWOOT_READY,
|
||||
} from '../widget/constants/sdkEvents';
|
||||
import { CHATWOOT_ERROR, CHATWOOT_READY } from '../widget/constants/sdkEvents';
|
||||
import { SET_USER_ERROR } from '../widget/constants/errorTypes';
|
||||
import { getUserCookieName, setCookieWithDomain } from './cookieHelpers';
|
||||
import {
|
||||
@@ -191,8 +187,8 @@ export const IFrameHelper = {
|
||||
Cookies.remove(getUserCookieName());
|
||||
}
|
||||
},
|
||||
onMessage({ data }) {
|
||||
dispatchWindowEvent({ eventName: CHATWOOT_ON_MESSAGE, data });
|
||||
onEvent({ eventIdentifier: eventName, data }) {
|
||||
dispatchWindowEvent({ eventName, data });
|
||||
},
|
||||
setBubbleLabel(message) {
|
||||
setBubbleText(window.$chatwoot.launcherTitle || message.label);
|
||||
|
||||
Reference in New Issue
Block a user