Skip to content

Commit 0064037

Browse files
YulNaumenkosushrut111elasticmachine
authored
Prevent multiple calls to backend from UI (#77970) (#79196)
* Prevent multiple call to backend from UI - Prevent multiple calls to backend from UI on updating the filters * Committing the fix - Watch only for the combined change in typesFilter and actionTypesFilter * UseEffect on string of typeFilter and actionTypeFilter - We are only concerned about the values of the two props and not whether the object references change. In other words, two separate empty arrays should be same for us. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Sushrut Kasture <kasturesushrut@gmail.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent af2aab6 commit 0064037

File tree

1 file changed

+6
-1
lines changed
  • x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components

1 file changed

+6
-1
lines changed

x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ export const AlertsList: React.FunctionComponent = () => {
9393
useEffect(() => {
9494
loadAlertsData();
9595
// eslint-disable-next-line react-hooks/exhaustive-deps
96-
}, [alertTypesState, page, searchText, typesFilter, actionTypesFilter]);
96+
}, [alertTypesState, page, searchText]);
97+
98+
useEffect(() => {
99+
loadAlertsData();
100+
// eslint-disable-next-line react-hooks/exhaustive-deps
101+
}, [JSON.stringify(typesFilter), JSON.stringify(actionTypesFilter)]);
97102

98103
useEffect(() => {
99104
(async () => {

0 commit comments

Comments
 (0)