0351d front end linting (#377)
* feat: disable custom script for trial users * after lint fix * frontend linting --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -1,33 +1,34 @@
|
||||
<template />
|
||||
|
||||
<script>
|
||||
import { computed } from 'vue'
|
||||
import { useAuthStore } from '../../stores/auth'
|
||||
import { computed } from "vue"
|
||||
import { useAuthStore } from "../../stores/auth"
|
||||
|
||||
export default {
|
||||
components: { },
|
||||
layout: 'default',
|
||||
middleware: 'auth',
|
||||
components: {},
|
||||
layout: "default",
|
||||
middleware: "auth",
|
||||
|
||||
setup () {
|
||||
setup() {
|
||||
useOpnSeoMeta({
|
||||
title: 'Error'
|
||||
title: "Error",
|
||||
})
|
||||
|
||||
const authStore = useAuthStore()
|
||||
return {
|
||||
authenticated : computed(() => authStore.check),
|
||||
authenticated: computed(() => authStore.check),
|
||||
}
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
}),
|
||||
data: () => ({}),
|
||||
|
||||
mounted () {
|
||||
this.$router.push({ name: 'pricing' })
|
||||
useAlert().error('Unfortunately we could not confirm your subscription. Please try again and contact us if the issue persists.')
|
||||
computed: {},
|
||||
|
||||
mounted() {
|
||||
this.$router.push({ name: "pricing" })
|
||||
useAlert().error(
|
||||
"Unfortunately we could not confirm your subscription. Please try again and contact us if the issue persists.",
|
||||
)
|
||||
},
|
||||
|
||||
computed: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<div class="flex flex-col min-h-screen">
|
||||
<div class="w-full md:max-w-3xl md:mx-auto px-4 mb-10 md:pb-20 md:pt-16 text-center flex-grow">
|
||||
<div
|
||||
class="w-full md:max-w-3xl md:mx-auto px-4 mb-10 md:pb-20 md:pt-16 text-center flex-grow"
|
||||
>
|
||||
<h1 class="text-4xl font-semibold">
|
||||
Thank you!
|
||||
</h1>
|
||||
@@ -16,63 +18,71 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { computed } from 'vue'
|
||||
import { useAuthStore } from '../../stores/auth'
|
||||
import { computed } from "vue"
|
||||
import { useAuthStore } from "../../stores/auth"
|
||||
|
||||
export default {
|
||||
layout: 'default',
|
||||
middleware: 'auth',
|
||||
layout: "default",
|
||||
middleware: "auth",
|
||||
|
||||
setup () {
|
||||
setup() {
|
||||
useOpnSeoMeta({
|
||||
title: 'Subscription Success'
|
||||
title: "Subscription Success",
|
||||
})
|
||||
|
||||
const authStore = useAuthStore()
|
||||
return {
|
||||
authStore,
|
||||
authenticated : computed(() => authStore.check),
|
||||
user : computed(() => authStore.user),
|
||||
crisp: useCrisp()
|
||||
authenticated: computed(() => authStore.check),
|
||||
user: computed(() => authStore.user),
|
||||
crisp: useCrisp(),
|
||||
}
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
interval: null
|
||||
interval: null,
|
||||
}),
|
||||
|
||||
mounted () {
|
||||
computed: {},
|
||||
|
||||
mounted() {
|
||||
this.redirectIfSubscribed()
|
||||
this.interval = setInterval(() => this.checkSubscription(), 5000)
|
||||
},
|
||||
|
||||
beforeUnmount () {
|
||||
beforeUnmount() {
|
||||
clearInterval(this.interval)
|
||||
},
|
||||
|
||||
methods: {
|
||||
async checkSubscription () {
|
||||
async checkSubscription() {
|
||||
// Fetch the user.
|
||||
await this.authStore.fetchUser()
|
||||
this.redirectIfSubscribed()
|
||||
},
|
||||
redirectIfSubscribed () {
|
||||
redirectIfSubscribed() {
|
||||
if (this.user.is_subscribed) {
|
||||
useAmplitude().logEvent('subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' })
|
||||
this.crisp.pushEvent('subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' })
|
||||
this.$router.push({ name: 'home' })
|
||||
useAmplitude().logEvent("subscribed", {
|
||||
plan: this.user.has_enterprise_subscription ? "enterprise" : "pro",
|
||||
})
|
||||
this.crisp.pushEvent("subscribed", {
|
||||
plan: this.user.has_enterprise_subscription ? "enterprise" : "pro",
|
||||
})
|
||||
this.$router.push({ name: "home" })
|
||||
|
||||
if (this.user.has_enterprise_subscription) {
|
||||
useAlert().success('Awesome! Your subscription to OpnForm is now confirmed! You now have access to all Enterprise ' +
|
||||
'features. No need to invite your teammates, just ask them to create a OpnForm account and to connect the same Notion workspace. Feel free to contact us if you have any question 🙌')
|
||||
useAlert().success(
|
||||
"Awesome! Your subscription to OpnForm is now confirmed! You now have access to all Enterprise " +
|
||||
"features. No need to invite your teammates, just ask them to create a OpnForm account and to connect the same Notion workspace. Feel free to contact us if you have any question 🙌",
|
||||
)
|
||||
} else {
|
||||
useAlert().success('Awesome! Your subscription to OpnForm is now confirmed! You now have access to all Pro ' +
|
||||
'features. Feel free to contact us if you have any question 🙌')
|
||||
useAlert().success(
|
||||
"Awesome! Your subscription to OpnForm is now confirmed! You now have access to all Pro " +
|
||||
"features. Feel free to contact us if you have any question 🙌",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
computed: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user