mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
chore: Add chatwoot:on-message event (#6425)
This commit is contained in:
@@ -23,7 +23,11 @@ import {
|
||||
} from './bubbleHelpers';
|
||||
import { isWidgetColorLighter } from 'shared/helpers/colorHelper';
|
||||
import { dispatchWindowEvent } from 'shared/helpers/CustomEventHelper';
|
||||
import { CHATWOOT_ERROR, CHATWOOT_READY } from '../widget/constants/sdkEvents';
|
||||
import {
|
||||
CHATWOOT_ERROR,
|
||||
CHATWOOT_ON_MESSAGE,
|
||||
CHATWOOT_READY,
|
||||
} from '../widget/constants/sdkEvents';
|
||||
import { SET_USER_ERROR } from '../widget/constants/errorTypes';
|
||||
import { getUserCookieName } from './cookieHelpers';
|
||||
import {
|
||||
@@ -177,7 +181,9 @@ export const IFrameHelper = {
|
||||
Cookies.remove(getUserCookieName());
|
||||
}
|
||||
},
|
||||
|
||||
onMessage({ data }) {
|
||||
dispatchWindowEvent({ eventName: CHATWOOT_ON_MESSAGE, data });
|
||||
},
|
||||
setBubbleLabel(message) {
|
||||
setBubbleText(window.$chatwoot.launcherTitle || message.label);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user