Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit 4cba6af

Browse files
committed
fix: Stop Filter hitting max call depth when appliedFilters is undefined
Currently `appliedFilters` can be `undefined`, except when it is when we try to `setLocalPinnedFilters`, we'll do so forever because we fail the check to decide whether to try set state or not every time, as `!allAppliedFilterKeysInLocalPinnedFilters` will always be `true`. To avoid this, we should only try to make the local pinned filters match if we actually have any applied filters - and it's not `undefined`. Found this while trying to bump to `v11.20.0`. This was introduced in: * #10566
1 parent 6a6f6fc commit 4cba6af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

polaris-react/src/components/Filters/Filters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export function Filters({
165165
);
166166

167167
useEffect(() => {
168-
const allAppliedFilterKeysInLocalPinnedFilters = appliedFilterKeys?.every(
168+
const allAppliedFilterKeysInLocalPinnedFilters = appliedFilterKeys && appliedFilterKeys?.every(
169169
(value) => localPinnedFilters.includes(value),
170170
);
171171

0 commit comments

Comments
 (0)