fix(notification): ensure applyExisting is not saved to database (#7221)

This commit is contained in:
Louis Lam
2026-03-29 23:12:44 +08:00
committed by GitHub
parent 7188e054d8
commit a5f30d4cc8
2 changed files with 9 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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;
}
}