Skip to content

Commit 344170d

Browse files
committed
fixup! front: add waypoint menu in manchette
1 parent c0d1283 commit 344170d

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

front/src/modules/simulationResult/components/SpaceTimeChart/useWaypointMenu.tsx

+18-20
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,24 @@ const useWaypointMenu = (waypointsPanelData?: WaypointsPanelData) => {
5959
disabledMessage: t('waypointsPanel.warning'),
6060
onClick: () => {
6161
closeMenu();
62-
if (setFilteredWaypoints) {
63-
setFilteredWaypoints((prevFilteredWaypoints) => {
64-
const newFilteredWaypoints = prevFilteredWaypoints.filter(
65-
(waypoint) => waypoint.id !== activeWaypointId
66-
);
67-
68-
// We need to removed the id because it can change for waypoints added by map click
69-
const simplifiedPath = projectionPath?.map((waypoint) =>
70-
omit(waypoint, ['id', 'deleted'])
71-
);
72-
73-
// TODO : when switching to the manchette back-end manager, remove all logic using
74-
// cleanScenarioLocalStorage from projet/study/scenario components (single/multi select)
75-
localStorage.setItem(
76-
`${timetableId}-${JSON.stringify(simplifiedPath)}`,
77-
JSON.stringify(newFilteredWaypoints)
78-
);
79-
return newFilteredWaypoints;
80-
});
81-
}
62+
setFilteredWaypoints?.((prevFilteredWaypoints) => {
63+
const newFilteredWaypoints = prevFilteredWaypoints.filter(
64+
(waypoint) => waypoint.id !== activeWaypointId
65+
);
66+
67+
// We need to removed the id because it can change for waypoints added by map click
68+
const simplifiedPath = projectionPath?.map((waypoint) =>
69+
omit(waypoint, ['id', 'deleted'])
70+
);
71+
72+
// TODO : when switching to the manchette back-end manager, remove all logic using
73+
// cleanScenarioLocalStorage from projet/study/scenario components (single/multi select)
74+
localStorage.setItem(
75+
`${timetableId}-${JSON.stringify(simplifiedPath)}`,
76+
JSON.stringify(newFilteredWaypoints)
77+
);
78+
return newFilteredWaypoints;
79+
});
8280
},
8381
},
8482
];

0 commit comments

Comments
 (0)