Przeglądaj źródła

Check that alert notification with id already exists in notification settings

Pavel Bakulev 7 lat temu
rodzic
commit
c27bf6e688
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      public/app/features/alerting/AlertTabCtrl.ts

+ 3 - 1
public/app/features/alerting/AlertTabCtrl.ts

@@ -141,7 +141,9 @@ export class AlertTabCtrl {
       iconClass: this.getNotificationIcon(model.type),
       iconClass: this.getNotificationIcon(model.type),
       isDefault: false,
       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
     // reset plus button
     this.addNotificationSegment.value = this.uiSegmentSrv.newPlusButton().value;
     this.addNotificationSegment.value = this.uiSegmentSrv.newPlusButton().value;