diff --git a/public/app/features/alerting/AlertTabCtrl.ts b/public/app/features/alerting/AlertTabCtrl.ts index ecde4aa0a4b..fe27f45e0f3 100644 --- a/public/app/features/alerting/AlertTabCtrl.ts +++ b/public/app/features/alerting/AlertTabCtrl.ts @@ -140,6 +140,7 @@ export class AlertTabCtrl { name: model.name, iconClass: this.getNotificationIcon(model.type), isDefault: false, + uid: model.uid }); if (!_.find(this.alert.notifications, { id: model.id})) { this.alert.notifications.push({ uid: model.uid }); @@ -151,9 +152,9 @@ export class AlertTabCtrl { this.addNotificationSegment.fake = true; } - removeNotification(index) { - this.alert.notifications.splice(index, 1); - this.alertNotifications.splice(index, 1); + removeNotification(deleteUid) { + _.remove(this.alert.notifications, { uid: deleteUid}); + _.remove(this.alertNotifications, { uid: deleteUid}); } initModel() { diff --git a/public/app/features/alerting/partials/alert_tab.html b/public/app/features/alerting/partials/alert_tab.html index 9dfd3da47f9..27518a1e44b 100644 --- a/public/app/features/alerting/partials/alert_tab.html +++ b/public/app/features/alerting/partials/alert_tab.html @@ -135,7 +135,7 @@