Skip to content

Commit

Permalink
fix: logical error in toggleGroupOp function within the `useFilterG…
Browse files Browse the repository at this point in the history
…roup` hook
  • Loading branch information
lawvs committed Sep 12, 2024
1 parent f3c2bac commit 479f048
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/plenty-spoons-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fn-sphere/filter": patch
---

Fix logical error in `toggleGroupOp` function within the `useFilterGroup` hook
2 changes: 1 addition & 1 deletion packages/filter/src/hooks/use-filter-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const useFilterGroup = (ruleGroup: FilterGroup) => {

const toggleGroupOp = (op?: FilterGroup["op"]) => {
const oldOp = ruleGroup.op;
const newOp = (op ?? ruleGroup.op === "and") ? "or" : "and";
const newOp = op ?? (ruleGroup.op === "and" ? "or" : "and");
if (oldOp === newOp) {
return;
}
Expand Down

0 comments on commit 479f048

Please sign in to comment.