Skip to content

Commit 2e3dcd2

Browse files
committed
Fix route selection after delete
When deleting an existing route, also clear route editor UI state: - Stop route editing mode - Clear selected route id This prevents deleted routes from staying highlighted/selected on the map. User story: 31281 Task: 78763
1 parent d5fc2c2 commit 2e3dcd2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ui/src/components/map/routes/RouteEditor.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ const RouteEditorComponent: ForwardRefRenderFunction<ExplicitAny> = (
298298
await deleteRoute(editedRouteId);
299299
showSuccessToast(t(($) => $.routes.deleteSuccess));
300300

301+
// clear the route from the map and reset redux state
302+
dispatch(stopRouteEditingAction());
303+
dispatch(setSelectedRouteIdAction(undefined));
304+
301305
setIsDeleting(false);
302306
resetUrlState();
303307
} catch (err) {

0 commit comments

Comments
 (0)