fix editing routes in UI

This commit is contained in:
Evan Scamehorn
2025-12-04 14:38:44 -06:00
parent 04167c656a
commit e0be371bbc

View File

@@ -225,9 +225,11 @@ export class UIManager {
btnEdit.title = "Redraw Route"; btnEdit.title = "Redraw Route";
btnEdit.style.padding = "4px 8px"; btnEdit.style.padding = "4px 8px";
btnEdit.onclick = () => { btnEdit.onclick = () => {
// Edit flow: Enter draft mode with existing data // --- FIX IS HERE ---
// 1. Enter draft mode first (this resets the drafting state)
this.enterDraftMode();
// 2. Load the route data (this populates the drafting state)
this.routeManager.editSavedRoute(index); this.routeManager.editSavedRoute(index);
this.enterDraftMode(); // UI Change
}; };
const btnDel = document.createElement('button'); const btnDel = document.createElement('button');