diff --git a/src/hooks/useAlertsPageData.js b/src/hooks/useAlertsPageData.js index 27b4d8282..0ea14ccc2 100644 --- a/src/hooks/useAlertsPageData.js +++ b/src/hooks/useAlertsPageData.js @@ -64,12 +64,10 @@ export const useAlertsPageData = (filters, isAlertsPage) => { ) .unwrap() .then(response => { - if (response?.activations?.length > 0) { - setAlerts(response.activations) - } else { - setAlerts([]) + if (response?.activations) { + setAlerts(response.activations.length > 0 ? response.activations : []) + paginationConfigAlertsRef.current.paginationResponse = response.pagination } - paginationConfigAlertsRef.current.paginationResponse = response.pagination }) }, [dispatch, isAlertsPage, params.id, params.projectName]