From 078d1f96a50cd7ee0e0f50f5486f4b943a71b6f4 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Tue, 25 Apr 2023 18:17:32 +0800 Subject: [PATCH] Better handling for old added ntfy notifications --- src/components/notifications/Ntfy.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/notifications/Ntfy.vue b/src/components/notifications/Ntfy.vue index ae227972..45776a93 100644 --- a/src/components/notifications/Ntfy.vue +++ b/src/components/notifications/Ntfy.vue @@ -65,7 +65,15 @@ export default { if (typeof this.$parent.notification.ntfyPriority === "undefined") { this.$parent.notification.ntfyserverurl = "https://ntfy.sh"; this.$parent.notification.ntfyPriority = 5; - this.$parent.notification.ntfyAuthenticationMethod = "none"; + } + + // Handling notifications that added before 1.22.0 + if (typeof this.$parent.notification.ntfyAuthenticationMethod === "undefined") { + if (!this.$parent.notification.ntfyusername) { + this.$parent.notification.ntfyAuthenticationMethod = "none"; + } else { + this.$parent.notification.ntfyAuthenticationMethod = "usernamePassword"; + } } }, };