Skip to content

Commit

Permalink
only filter automatically watered plants in watered activity
Browse files Browse the repository at this point in the history
  • Loading branch information
repolevedavaj committed May 30, 2022
1 parent a185c9e commit dd1d806
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export default () => {

useOnFocusOnceEffect(() => {
PlantRepository.selectAllPlants().then((plants) => {
setPlants(plants.filter(plant => !plant.automaticallyWatered));
if (route.params.activityType === ActivityType.ACTIVITY_TYPE_WATERED) {
plants = plants.filter(plant => !plant.automaticallyWatered)
}

setPlants(plants);
});
});

Expand Down

0 comments on commit dd1d806

Please sign in to comment.