Skip to content

Beautiful Open-Source Form Builder

fix notification settings actions (#216)

formsdev95b2870e2f02
diff --git a/resources/js/components/open/forms/components/form-components/components/FormNotificationsDiscord.vue b/resources/js/components/open/forms/components/form-components/components/FormNotificationsDiscord.vue
index 3ebca14b7..ddb28f259 100644
--- a/resources/js/components/open/forms/components/form-components/components/FormNotificationsDiscord.vue
+++ b/resources/js/components/open/forms/components/form-components/components/FormNotificationsDiscord.vue
@@ -73,6 +73,9 @@ export default {
watch: {},
mounted () {
+ if(!this.form.notification_settings.discord){
+ this.form.notification_settings.discord = {}
+ }
},
methods: {}
diff --git a/resources/js/components/open/forms/components/form-components/components/FormNotificationsMessageActions.vue b/resources/js/components/open/forms/components/form-components/components/FormNotificationsMessageActions.vue
index 135e54d0b..1b9ac5c23 100644
--- a/resources/js/components/open/forms/components/form-components/components/FormNotificationsMessageActions.vue
+++ b/resources/js/components/open/forms/components/form-components/components/FormNotificationsMessageActions.vue
@@ -30,7 +30,7 @@ export default {
},
data () {
return {
- content: this.value
+ content: this.value ?? {}
}
},
@@ -48,7 +48,7 @@ export default {
watch: {},
- mounted () {
+ created () {
if(this.compVal === undefined || this.compVal === null){
this.compVal = {}
}
diff --git a/resources/js/components/open/forms/components/form-components/components/FormNotificationsSlack.vue b/resources/js/components/open/forms/components/form-components/components/FormNotificationsSlack.vue
index 0de50b8be..bfc0d5739 100644
--- a/resources/js/components/open/forms/components/form-components/components/FormNotificationsSlack.vue
+++ b/resources/js/components/open/forms/components/form-components/components/FormNotificationsSlack.vue
@@ -74,6 +74,9 @@ export default {
watch: {},
mounted () {
+ if(!this.form.notification_settings.slack){
+ this.form.notification_settings.slack = {}
+ }
},
methods: {}
diff --git a/resources/js/pages/forms/edit.vue b/resources/js/pages/forms/edit.vue
index 23bf60b6e..a261fe63b 100644
--- a/resources/js/pages/forms/edit.vue
+++ b/resources/js/pages/forms/edit.vue
@@ -108,6 +108,10 @@ export default {
this.updatedForm = new Form(this.form)
this.formInitialHash = this.hashString(JSON.stringify(this.updatedForm.data()))
}
+
+ if(!this.updatedForm.notification_settings || Array.isArray(this.updatedForm.notification_settings)){
+ this.updatedForm.notification_settings = {}
+ }
},
methods: {