From ffbc25722d8fe086b83046ae94913aa5f6051d1b Mon Sep 17 00:00:00 2001 From: zsxeee Date: Sun, 19 Sep 2021 18:05:22 +0800 Subject: [PATCH] Move default setting to child component --- src/components/NotificationDialog.vue | 2 -- src/components/notifications/Gotify.vue | 5 +++++ src/components/notifications/SMTP.vue | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 4b1b0cc40..78d890919 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -150,8 +150,6 @@ export default { // Set Default value here this.notification.type = this.notificationTypes[0]; - this.notification.gotifyPriority = 8; - this.notification.smtpSecure = false; } this.modal.show() diff --git a/src/components/notifications/Gotify.vue b/src/components/notifications/Gotify.vue index 737a297a8..f8039d58a 100644 --- a/src/components/notifications/Gotify.vue +++ b/src/components/notifications/Gotify.vue @@ -23,5 +23,10 @@ export default { components: { HiddenInput, }, + mounted() { + if (typeof this.$parent.notification.gotifyPriority === "undefined") { + this.$parent.notification.gotifyPriority = 8; + } + }, } diff --git a/src/components/notifications/SMTP.vue b/src/components/notifications/SMTP.vue index d2d1e9df1..b86a62608 100644 --- a/src/components/notifications/SMTP.vue +++ b/src/components/notifications/SMTP.vue @@ -66,5 +66,10 @@ export default { components: { HiddenInput, }, + mounted() { + if (typeof this.$parent.notification.smtpSecure === "undefined") { + this.$parent.notification.smtpSecure = false; + } + }, }