From 9f909d1b13ebf212c3f05d37cf18154cf7931bae Mon Sep 17 00:00:00 2001 From: formsdev <136701234+formsdev@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:18:43 +0530 Subject: [PATCH] crisp migration (#302) Co-authored-by: Julien Nahum --- client/components/global/ProTag.vue | 3 +-- .../forms/components/form-components/FormAboutSubmission.vue | 5 +++-- client/components/pages/forms/show/FormCleanings.vue | 3 +-- client/components/pages/pricing/CustomPlan.vue | 4 +--- client/pages/pricing.vue | 3 +-- client/pages/subscriptions/success.vue | 5 +++-- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/client/components/global/ProTag.vue b/client/components/global/ProTag.vue index 841aed9..0aac4d7 100644 --- a/client/components/global/ProTag.vue +++ b/client/components/global/ProTag.vue @@ -77,8 +77,7 @@ export default { methods: { openChat() { - window.$crisp.push(['do', 'chat:show']) - window.$crisp.push(['do', 'chat:open']) + useCrisp().openAndShowChat() }, } } diff --git a/client/components/open/forms/components/form-components/FormAboutSubmission.vue b/client/components/open/forms/components/form-components/FormAboutSubmission.vue index b1230b7..829974f 100644 --- a/client/components/open/forms/components/form-components/FormAboutSubmission.vue +++ b/client/components/open/forms/components/form-components/FormAboutSubmission.vue @@ -67,7 +67,7 @@ If the submission has the same value(s) as a previous one for the selected column(s), we will update it, instead of creating a new one. More info here. @@ -142,7 +142,8 @@ export default { const {content: form} = storeToRefs(workingFormStore) return { form, - workingFormStore + workingFormStore, + crisp: useCrisp() } }, data () { diff --git a/client/components/pages/forms/show/FormCleanings.vue b/client/components/pages/forms/show/FormCleanings.vue index 29def81..fe174e1 100644 --- a/client/components/pages/forms/show/FormCleanings.vue +++ b/client/components/pages/forms/show/FormCleanings.vue @@ -99,8 +99,7 @@ export default { }, methods: { openCrisp () { - this.$crisp.push(['do', 'chat:show']) - this.$crisp.push(['do', 'chat:open']) + useCrisp().openAndShowChat() } } } diff --git a/client/components/pages/pricing/CustomPlan.vue b/client/components/pages/pricing/CustomPlan.vue index c4f1704..29fc2f4 100644 --- a/client/components/pages/pricing/CustomPlan.vue +++ b/client/components/pages/pricing/CustomPlan.vue @@ -32,9 +32,7 @@ export default { methods: { customPlanClick () { - window.$crisp.push(['do', 'chat:show']) - window.$crisp.push(['do', 'chat:open']) - window.$crisp.push(['do', 'message:send', ['text', 'Hi, I would like to discuss about a custom plan']]) + useCrisp().sendTextMessage('Hi, I would like to discuss about a custom plan') } } } diff --git a/client/pages/pricing.vue b/client/pages/pricing.vue index a0a7f4b..f3ae5f1 100644 --- a/client/pages/pricing.vue +++ b/client/pages/pricing.vue @@ -271,8 +271,7 @@ export default { methods: { contactUs() { - window.$crisp.push(['do', 'chat:show']) - window.$crisp.push(['do', 'chat:open']) + useCrisp().openAndShowChat() } } } diff --git a/client/pages/subscriptions/success.vue b/client/pages/subscriptions/success.vue index df63c75..83e7db3 100644 --- a/client/pages/subscriptions/success.vue +++ b/client/pages/subscriptions/success.vue @@ -32,7 +32,8 @@ export default { return { authStore, authenticated : computed(() => authStore.check), - user : computed(() => authStore.user) + user : computed(() => authStore.user), + crisp: useCrisp() } }, @@ -58,7 +59,7 @@ export default { redirectIfSubscribed () { if (this.user.is_subscribed) { useAmplitude().logEvent('subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' }) - this.$crisp.push(['set', 'session:event', [[['subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' }, 'blue']]]]) + this.crisp.pushEvent('subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' }) this.$router.push({ name: 'home' }) if (this.user.has_enterprise_subscription) {