From b95404b6e0f0fff4a13e7f0469c40f47a90e8f5a Mon Sep 17 00:00:00 2001 From: Ponkhy Date: Sun, 5 Sep 2021 23:23:06 +0200 Subject: [PATCH] Fixed suggestions --- db/patch9.sql | 2 +- src/pages/EditMonitor.vue | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/db/patch9.sql b/db/patch9.sql index 3f631ff8..d4d13aab 100644 --- a/db/patch9.sql +++ b/db/patch9.sql @@ -2,6 +2,6 @@ BEGIN TRANSACTION; ALTER TABLE notification - ADD is_default BOOLEAN; + ADD is_default BOOLEAN default 0 NOT NULL; COMMIT; diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 496469f8..ed09a7ba 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -298,16 +298,16 @@ export default { dns_resolve_type: "A", dns_resolve_server: "1.1.1.1", } + + for (let i = 0; i < this.$root.notificationList.length; i++) { + if (this.$root.notificationList[i].isDefault == true) { + this.monitor.notificationIDList[this.$root.notificationList[i].id] = true; + } + } } else if (this.isEdit) { this.$root.getSocket().emit("getMonitor", this.$route.params.id, (res) => { if (res.ok) { this.monitor = res.monitor; - - for (let i = 0; i < this.$root.notificationList.length; i++) { - if (this.$root.notificationList[i].isDefault == true) { - this.monitor.notificationIDList[this.$root.notificationList[i].id] = true; - } - } } else { toast.error(res.msg) }