Skip to content

Commit

Permalink
clean up logic
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonfcohen1 committed Apr 21, 2024
1 parent b44b024 commit ae686bd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/components/PropertyMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,22 +175,20 @@ const PropertyMap: FC<PropertyMapProps> = ({
const mapFilter = Object.entries(appFilter).reduce(
(acc, [property, filterItem]) => {
if (filterItem.values.length) {
const useIndexOfFilterFilter: any = ["any"];
const thisFilterGroup: any = ["any"];
filterItem.values.forEach((item) => {
if (filterItem.useIndexOfFilter) {
useIndexOfFilterFilter.push([
thisFilterGroup.push([
">=",
["index-of", item, ["get", property]],
0,
]);
} else {
acc.push(["in", ["get", property], item]);
thisFilterGroup.push(["in", ["get", property], item]);
}
});

if (filterItem.useIndexOfFilter) {
acc.push(useIndexOfFilterFilter);
}
acc.push(thisFilterGroup);
}
return acc;
},
Expand Down

0 comments on commit ae686bd

Please sign in to comment.