Skip to content

Commit

Permalink
change required clicks and automatic update to show table
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoKle committed Jul 15, 2023
1 parent c613fff commit d79f322
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions frontend/src/components/Markers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ function Markers({ conditions }: { conditions: WaypointRecord[] }) {

const handleMarkerClick = (name: string) => {
setDrawnConditions(previousValue => {
const index = previousValue.findIndex(element => element.waypoint.name === name);

previousValue[index].drawn = !previousValue[index].drawn;

return previousValue;
return previousValue.map(condition => {
if (condition.waypoint.name === name) {
return {
...condition,
drawn: !condition.drawn,
};
}
return condition;
});
});
};

Expand Down

0 comments on commit d79f322

Please sign in to comment.