Open markus2330 opened 9 months ago
Do you know why the side effects described in "Conclusion after searching:" happen? @danielsteinkogler
@hatchla btw. did you see what was done in https://github.com/ElektraInitiative/PermaplanT/pull/1104? Is this the same approach you wanted to take?
@hatchla btw. did you see what was done in #1104? Is this the same approach you wanted to take?
I did not know about this PR, but it seems to be very similar. What was the reason for it not getting merged into master? @markus2330
IIRC it aborted the planting mode
IIRC it aborted the planting mode
The same thing happens to my first approach... It seems that planting mode and selection can not happen or can not be stored simultaneously in the stateMap.
Tasks
Use case
plant_layer
Related Pull request
No response
Conclusion after searching:
The following line might suffice to manually add a selected plant to the mapstore: useMapStore.getState().selectPlantings(plantings, useTransformerStore.getState()); This has been taken from frontend/src/features/map_planning/layers/plant/PlantsLayer.tsx:210 (handleSelectPlanting).
The following could be added to CreatePlantAction.execute in frontend/src/features/map_planning/layers/plant/actions.ts:75 but leads to leaving the planting mode:
When again setting the selectPlantForPlanting, the selectPlantings seems to be overwritten again which leads to the initial state without any changes.
It seems that only one of these states can be stored in the mapstore.