diff --git a/server/notification.js b/server/notification.js index 3e9085747..29a60a8fc 100644 --- a/server/notification.js +++ b/server/notification.js @@ -245,13 +245,17 @@ class Notification { bean = R.dispense("notification"); } + // applyExisting is one time only, don't save it to database. + const applyExisting = notification.applyExisting || false; + notification.applyExisting = false; + bean.name = notification.name; bean.user_id = userID; bean.config = JSON.stringify(notification); bean.is_default = notification.isDefault || false; await R.store(bean); - if (notification.applyExisting) { + if (applyExisting) { await applyNotificationEveryMonitor(bean.id, userID); } diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 10aebd544..6250c4900 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -416,6 +416,10 @@ export default { for (let n of this.$root.notificationList) { if (n.id === notificationID) { this.notification = JSON.parse(n.config); + + // applyExisting is one time only, but it got saved to database previously. Workaround fix, set it to false here to deal with the problem. + this.notification.applyExisting = false; + break; } }