From 95b2870e2f02f9ca0148d85b47453e1f72887530 Mon Sep 17 00:00:00 2001 From: formsdev <136701234+formsdev@users.noreply.github.com> Date: Sun, 8 Oct 2023 13:58:46 +0530 Subject: [PATCH] fix notification settings actions (#216) --- .../form-components/components/FormNotificationsDiscord.vue | 3 +++ .../components/FormNotificationsMessageActions.vue | 4 ++-- .../form-components/components/FormNotificationsSlack.vue | 3 +++ resources/js/pages/forms/edit.vue | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) 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: {