Skip to content

Commit

Permalink
Fix log filter URL state infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Dec 20, 2019
1 parent a7fe3ef commit 43302b3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export const useLogFilterUrlState = () => {
});

/* eslint-disable react-hooks/exhaustive-deps */
useEffect(() => applyLogFilterQuery(logFilterUrlState.expression), [logFilterUrlState]);
useEffect(() => {
if (logFilterUrlState && filterQueryAsKuery?.expression !== logFilterUrlState.expression) {
applyLogFilterQuery(logFilterUrlState.expression);
}
}, [logFilterUrlState]);
useEffect(() => setLogFilterUrlState(filterQueryAsKuery), [filterQueryAsKuery]);
/* eslint-enable react-hooks/exhaustive-deps */
};
Expand Down

0 comments on commit 43302b3

Please sign in to comment.