Check that alert notification with id already exists in notification settings

This commit is contained in:
Pavel Bakulev
2019-01-18 16:19:06 +02:00
parent 6a8e39ba17
commit c27bf6e688

View File

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