feat: Add the SDK method to programatically toggle live chat bubble (#4223)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Fayaz Ahmed
2022-05-06 19:30:48 +05:30
committed by GitHub
parent 80b8f5f915
commit ef850eda0f
10 changed files with 79 additions and 28 deletions

View File

@@ -38,6 +38,9 @@ import {
ON_CAMPAIGN_MESSAGE_CLICK,
ON_UNREAD_MESSAGE_CLICK,
} from './constants/widgetBusEvents';
import { SDK_SET_BUBBLE_VISIBILITY } from '../shared/constants/sharedFrameEvents';
export default {
name: 'App',
components: {
@@ -103,6 +106,7 @@ export default {
'setAppConfig',
'setReferrerHost',
'setWidgetColor',
'setBubbleVisibility',
]),
...mapActions('conversation', ['fetchOldConversations', 'setUserLastSeen']),
...mapActions('campaign', [
@@ -285,6 +289,8 @@ export default {
if (!message.isOpen) {
this.resetCampaign();
}
} else if (message.event === SDK_SET_BUBBLE_VISIBILITY) {
this.setBubbleVisibility(message.hideMessageBubble);
}
});
},