Skip to content

Commit

Permalink
reload alerts when an alert is deleted in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Jul 29, 2020
1 parent 2f93a6e commit 12ff182
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,17 +400,8 @@ export const AlertsList: React.FunctionComponent = () => {
<section data-test-subj="alertsList">
<DeleteModalConfirmation
onDeleted={(deleted: string[]) => {
if (selectedIds.length === 0 || selectedIds.length === deleted.length) {
const updatedAlerts = alertsState.data.filter(
(alert) => alert.id && !alertsToDelete.includes(alert.id)
);
setAlertsState({
isLoading: false,
data: updatedAlerts,
totalItemCount: alertsState.totalItemCount - deleted.length,
});
setSelectedIds([]);
}
loadAlertsData();
setSelectedIds([]);
setAlertsToDelete([]);
}}
onErrors={async () => {
Expand Down

0 comments on commit 12ff182

Please sign in to comment.