Crisp fix (#42)
This commit is contained in:
parent
07f44ec048
commit
66a5d4f3a4
|
@ -4,7 +4,11 @@
|
|||
import debounce from 'debounce'
|
||||
|
||||
export default {
|
||||
computed: {},
|
||||
computed: {
|
||||
$crisp () {
|
||||
return window.$crisp
|
||||
}
|
||||
},
|
||||
|
||||
metaInfo () {
|
||||
const info = {
|
||||
|
@ -39,49 +43,50 @@ export default {
|
|||
/**
|
||||
* Show an error message.
|
||||
*/
|
||||
alertError (message, autoClose=10000) {
|
||||
alertError (message, autoClose = 10000) {
|
||||
this.$notify(
|
||||
{
|
||||
title: 'Error',
|
||||
text: message,
|
||||
type: 'error',
|
||||
type: 'error'
|
||||
}, autoClose)
|
||||
},
|
||||
|
||||
/**
|
||||
* Show a success message.
|
||||
*/
|
||||
alertSuccess (message, autoClose=10000) {
|
||||
alertSuccess (message, autoClose = 10000) {
|
||||
this.$notify(
|
||||
{
|
||||
title: 'Success',
|
||||
text: message,
|
||||
type: 'success',
|
||||
type: 'success'
|
||||
}, autoClose)
|
||||
},
|
||||
|
||||
/**
|
||||
* Show a warning message.
|
||||
*/
|
||||
alertWarning (message, autoClose=10000) {
|
||||
alertWarning (message, autoClose = 10000) {
|
||||
this.$notify(
|
||||
{
|
||||
title: 'Warning',
|
||||
text: message,
|
||||
type: 'warning',
|
||||
type: 'warning'
|
||||
}, autoClose)
|
||||
},
|
||||
|
||||
/**
|
||||
* Show confirmation message.
|
||||
*/
|
||||
alertConfirm (message, success, failure, autoClose= 10000) {
|
||||
alertConfirm (message, success, failure = ()=>{}, autoClose = 10000) {
|
||||
this.$notify(
|
||||
{
|
||||
title: 'Confirm',
|
||||
text: message,
|
||||
type: 'confirm',
|
||||
success, failure
|
||||
success,
|
||||
failure
|
||||
}, autoClose)
|
||||
},
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ export function initCrisp (user) {
|
|||
window.$crisp.push(['set', 'user:email', user.email])
|
||||
window.$crisp.push(['set', 'user:nickname', user.name])
|
||||
window.$crisp.push(['set', 'session:data', [[
|
||||
['pro-subscription', user.is_subscribed],
|
||||
['pro-subscription', user?.is_subscribed ?? false],
|
||||
['id', user.id]
|
||||
]]])
|
||||
window.clearInterval(intervalId)
|
||||
|
|
|
@ -111,9 +111,9 @@ export default {
|
|||
|
||||
// Track event
|
||||
this.$logEvent('register', { source: this.form.hear_about_us })
|
||||
initCrisp(data).then(() => {
|
||||
this.$getCrisp().push(['set', 'session:event', [[['register', {}, 'blue']]]])
|
||||
})
|
||||
|
||||
initCrisp(data)
|
||||
this.$crisp.push(['set', 'session:event', [[['register', {}, 'blue']]]])
|
||||
|
||||
// Redirect
|
||||
if(this.isQuick){
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
import Vue from 'vue'
|
||||
|
||||
import PortalVue from 'portal-vue'
|
||||
|
||||
import Notifications from "vt-notifications"
|
||||
|
||||
Vue.use(PortalVue)
|
||||
Vue.use(Notifications)
|
||||
|
||||
Vue.prototype.$getCrisp = () => {
|
||||
return window.$crisp
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue