Skip to content

Commit

Permalink
slight change in sunlight filtering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezryr committed Nov 7, 2024
1 parent 38f5f6a commit 016ebb3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ export function checkSunlight(
const [minHours, maxHours] = sunlightToHours.get(sunlight.value)!;
// if max_hours is null then plant can only receive min_hours of sunlight
if (plant.sunlight_max_hours === null) {
sunlightBoolean.push(plant.sunlight_min_hours >= minHours);
sunlightBoolean.push(
plant.sunlight_min_hours >= minHours &&
plant.sunlight_min_hours <= maxHours,
);
} else {
sunlightBoolean.push(
plant.sunlight_min_hours >= minHours &&
Expand Down

0 comments on commit 016ebb3

Please sign in to comment.