Skip to content

Commit 5bdc76e

Browse files
formsdevJhumanJ
andauthored
crisp migration (#302)
Co-authored-by: Julien Nahum <julien@nahum.net>
1 parent de3e2d6 commit 5bdc76e

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

client/components/global/ProTag.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ export default {
7777
7878
methods: {
7979
openChat() {
80-
window.$crisp.push(['do', 'chat:show'])
81-
window.$crisp.push(['do', 'chat:open'])
80+
useCrisp().openAndShowChat()
8281
},
8382
}
8483
}

client/components/open/forms/components/form-components/FormAboutSubmission.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<small>If the submission has the same value(s) as a previous one for the selected
6868
column(s), we will update it, instead of creating a new one.
6969
<a href="#"
70-
@click.prevent="$crisp.push(['do', 'helpdesk:article:open', ['en', 'how-to-update-a-page-on-form-submission-1t1jwmn']])"
70+
@click.prevent="crisp.openHelpdeskArticle('how-to-update-a-page-on-form-submission-1t1jwmn')"
7171
>More
7272
info here.</a>
7373
</small>
@@ -142,7 +142,8 @@ export default {
142142
const {content: form} = storeToRefs(workingFormStore)
143143
return {
144144
form,
145-
workingFormStore
145+
workingFormStore,
146+
crisp: useCrisp()
146147
}
147148
},
148149
data () {

client/components/pages/forms/show/FormCleanings.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ export default {
9999
},
100100
methods: {
101101
openCrisp () {
102-
this.$crisp.push(['do', 'chat:show'])
103-
this.$crisp.push(['do', 'chat:open'])
102+
useCrisp().openAndShowChat()
104103
}
105104
}
106105
}

client/components/pages/pricing/CustomPlan.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ export default {
3232
3333
methods: {
3434
customPlanClick () {
35-
window.$crisp.push(['do', 'chat:show'])
36-
window.$crisp.push(['do', 'chat:open'])
37-
window.$crisp.push(['do', 'message:send', ['text', 'Hi, I would like to discuss about a custom plan']])
35+
useCrisp().sendTextMessage('Hi, I would like to discuss about a custom plan')
3836
}
3937
}
4038
}

client/pages/pricing.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ export default {
271271
272272
methods: {
273273
contactUs() {
274-
window.$crisp.push(['do', 'chat:show'])
275-
window.$crisp.push(['do', 'chat:open'])
274+
useCrisp().openAndShowChat()
276275
}
277276
}
278277
}

client/pages/subscriptions/success.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default {
3232
return {
3333
authStore,
3434
authenticated : computed(() => authStore.check),
35-
user : computed(() => authStore.user)
35+
user : computed(() => authStore.user),
36+
crisp: useCrisp()
3637
}
3738
},
3839
@@ -58,7 +59,7 @@ export default {
5859
redirectIfSubscribed () {
5960
if (this.user.is_subscribed) {
6061
useAmplitude().logEvent('subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' })
61-
this.$crisp.push(['set', 'session:event', [[['subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' }, 'blue']]]])
62+
this.crisp.pushEvent('subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' })
6263
this.$router.push({ name: 'home' })
6364
6465
if (this.user.has_enterprise_subscription) {

0 commit comments

Comments
 (0)