Skip to content

Commit 43302b3

Browse files
committed
Fix log filter URL state infinite loop
1 parent a7fe3ef commit 43302b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

x-pack/legacy/plugins/infra/public/containers/logs/log_filter/use_log_filter_url_state.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export const useLogFilterUrlState = () => {
3232
});
3333

3434
/* eslint-disable react-hooks/exhaustive-deps */
35-
useEffect(() => applyLogFilterQuery(logFilterUrlState.expression), [logFilterUrlState]);
35+
useEffect(() => {
36+
if (logFilterUrlState && filterQueryAsKuery?.expression !== logFilterUrlState.expression) {
37+
applyLogFilterQuery(logFilterUrlState.expression);
38+
}
39+
}, [logFilterUrlState]);
3640
useEffect(() => setLogFilterUrlState(filterQueryAsKuery), [filterQueryAsKuery]);
3741
/* eslint-enable react-hooks/exhaustive-deps */
3842
};

0 commit comments

Comments
 (0)