Skip to content

Beautiful Open-Source Form Builder

Front-end error fixing

Julien Nahum32fd9f84a23a
diff --git a/resources/js/components/common/ProTag.vue b/resources/js/components/common/ProTag.vue
index e8b7915fd..1cc39eeb9 100644
--- a/resources/js/components/common/ProTag.vue
+++ b/resources/js/components/common/ProTag.vue
@@ -15,15 +15,15 @@
</h4>
<div v-if="!user || !user.is_subscribed" class="mt-4">
<p>
- All the features with a<span
+ All the features with a<span
class="bg-nt-blue text-white px-2 text-xs uppercase inline rounded-full font-semibold mx-1"
>
PRO
</span> tag are available in the Pro plan of OpnForm. <b>You can play around and try all Pro features
within
the form editor, but you can't use them in your real forms</b>. You can subscribe now to gain unlimited access
- to
- all our pro features!
+ to
+ all our pro features!
</p>
</div>
@@ -38,15 +38,15 @@
<script>
import Modal from '../Modal.vue'
-import { mapGetters } from 'vuex'
+import {mapGetters} from 'vuex'
import PricingTable from "../pages/pricing/PricingTable.vue";
export default {
name: 'ProTag',
- components: {PricingTable, Modal },
+ components: {PricingTable, Modal},
props: {},
- data () {
+ data() {
return {
showPremiumModal: false,
checkoutLoading: false
@@ -59,17 +59,17 @@ export default {
currentWorkSpace: 'open/workspaces/getCurrent',
}),
shouldDisplayProTag() {
- if(!window.config.paid_plans_enabled) return false
- if (!this.user) return true
- return !(this.currentWorkSpace().is_pro || this.currentWorkSpace().is_enterprise)
+ if (!window.config.paid_plans_enabled) return false
+ if (!this.user || !this.currentWorkSpace) return true
+ return !(this.currentWorkSpace.is_pro)
},
},
- mounted () {
+ mounted() {
},
methods: {
- openChat () {
+ openChat() {
window.$crisp.push(['do', 'chat:show'])
window.$crisp.push(['do', 'chat:open'])
},
diff --git a/resources/js/components/pages/forms/show/ExtraMenu.vue b/resources/js/components/pages/forms/show/ExtraMenu.vue
index 012e49650..4c56933c9 100644
--- a/resources/js/components/pages/forms/show/ExtraMenu.vue
+++ b/resources/js/components/pages/forms/show/ExtraMenu.vue
@@ -67,7 +67,7 @@
</svg>
Duplicate form
</a>
- <a href="#" v-if="user.template_editor"
+ <a href="#" v-if="user && user.template_editor"
class="block block px-4 py-2 text-md text-gray-700 dark:text-white hover:bg-gray-100 hover:text-gray-900 dark:text-gray-100 dark:hover:text-white dark:hover:bg-gray-600 flex items-center"
@click.prevent="showFormTemplateModal=true"
>
diff --git a/resources/js/pages/forms/create-guest.vue b/resources/js/pages/forms/create-guest.vue
index ef4429a85..0e79dcb5b 100644
--- a/resources/js/pages/forms/create-guest.vue
+++ b/resources/js/pages/forms/create-guest.vue
@@ -131,7 +131,9 @@ export default {
this.isGuest = false
this.loadWorkspaces()
setTimeout(() => {
- this.$refs.editor.saveFormCreate()
+ if (this.$refs.editor) {
+ this.$refs.editor.saveFormCreate()
+ }
}, 500)
},
formGenerated(form) {