mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-04-18 12:09:43 +00:00
fix(notification): ensure applyExisting is not saved to database (#7221)
This commit is contained in:
@@ -251,13 +251,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -419,6 +419,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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user