From d3bf8285247807c4d0d20728a6ccf4fc5db203a0 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Wed, 18 Oct 2023 04:54:00 +0530 Subject: [PATCH] chore: Adds hasConversation flag in chatwoot:on-start-conversation event (#8132) --- app/javascript/widget/components/ChatFooter.vue | 1 + app/javascript/widget/components/TeamAvailability.vue | 1 + app/views/widget_tests/index.html.erb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/javascript/widget/components/ChatFooter.vue b/app/javascript/widget/components/ChatFooter.vue index 53da736b7..9de6d4275 100755 --- a/app/javascript/widget/components/ChatFooter.vue +++ b/app/javascript/widget/components/ChatFooter.vue @@ -101,6 +101,7 @@ export default { IFrameHelper.sendMessage({ event: 'onEvent', eventIdentifier: CHATWOOT_ON_START_CONVERSATION, + data: { hasConversation: true }, }); }, async sendTranscript() { diff --git a/app/javascript/widget/components/TeamAvailability.vue b/app/javascript/widget/components/TeamAvailability.vue index 58e18b3e1..984dfbe3f 100644 --- a/app/javascript/widget/components/TeamAvailability.vue +++ b/app/javascript/widget/components/TeamAvailability.vue @@ -89,6 +89,7 @@ export default { IFrameHelper.sendMessage({ event: 'onEvent', eventIdentifier: CHATWOOT_ON_START_CONVERSATION, + data: { hasConversation: false }, }); } }, diff --git a/app/views/widget_tests/index.html.erb b/app/views/widget_tests/index.html.erb index 560cbd499..42e7583fb 100644 --- a/app/views/widget_tests/index.html.erb +++ b/app/views/widget_tests/index.html.erb @@ -62,6 +62,6 @@ window.addEventListener('chatwoot:on-message', function(e) { window.addEventListener('chatwoot:on-start-conversation', function(e) { - console.log('chatwoot:on-start-conversation') + console.log('chatwoot:on-start-conversation', e.detail) })