From 12ff182ca178bad6dbb0181fa21bf0661f7d8bd2 Mon Sep 17 00:00:00 2001 From: Gidi Meir Morris Date: Wed, 29 Jul 2020 18:02:33 +0100 Subject: [PATCH] reload alerts when an alert is deleted in the list --- .../sections/alerts_list/components/alerts_list.tsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx index 2b2897a2181b11..b67c41b6b64af8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx @@ -400,17 +400,8 @@ export const AlertsList: React.FunctionComponent = () => {
{ - 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 () => {