From c27bf6e688ab43cc2ef233d015d65938917f7fda Mon Sep 17 00:00:00 2001
From: Pavel Bakulev
Date: Fri, 18 Jan 2019 16:19:06 +0200
Subject: [PATCH] Check that alert notification with id already exists in
notification settings
---
public/app/features/alerting/AlertTabCtrl.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/public/app/features/alerting/AlertTabCtrl.ts b/public/app/features/alerting/AlertTabCtrl.ts
index d1accae6787..ecde4aa0a4b 100644
--- a/public/app/features/alerting/AlertTabCtrl.ts
+++ b/public/app/features/alerting/AlertTabCtrl.ts
@@ -141,7 +141,9 @@ export class AlertTabCtrl {
iconClass: this.getNotificationIcon(model.type),
isDefault: false,
});
- this.alert.notifications.push({ uid: model.uid });
+ if (!_.find(this.alert.notifications, { id: model.id})) {
+ this.alert.notifications.push({ uid: model.uid });
+ }
// reset plus button
this.addNotificationSegment.value = this.uiSegmentSrv.newPlusButton().value;