From ffbc25722d8fe086b83046ae94913aa5f6051d1b Mon Sep 17 00:00:00 2001
From: zsxeee <zsxeee@qq.com>
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 4b1b0cc..78d8909 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 737a297..f8039d5 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;
+        }
+    },
 }
 </script>
diff --git a/src/components/notifications/SMTP.vue b/src/components/notifications/SMTP.vue
index d2d1e9d..b86a626 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;
+        }
+    },
 }
 </script>