diff --git a/frontend/src/views/MapView.vue b/frontend/src/views/MapView.vue index 68b0547..f26c51f 100644 --- a/frontend/src/views/MapView.vue +++ b/frontend/src/views/MapView.vue @@ -301,11 +301,6 @@ watch( newStops.some((stop, idx) => stop.id !== oldStops[idx]?.id)) { console.log('Route stops changed - updating markers') - // FLOW REFINEMENT: Find the optimal entrance stop first - if (newStops.length > 0) { - await highlightOptimalStopForRoute(); - } - await updateMapMarkers(); } } @@ -394,11 +389,16 @@ async function updatePromoMarkers() { }); } -function selectRouteAndClose(routeId: string, routeName: string) { +async function selectRouteAndClose(routeId: string, routeName: string) { console.log(`🤖 JARVIS: Iniciando viaje hacia ${routeName}`); - routeStore.selectRoute(routeId, routeName); + await routeStore.selectRoute(routeId, routeName); showRouteDropdown.value = false; showUberSearch.value = false; // Close the expanded search panel + + // Highlight the optimal stop ONLY in this flow when initiated from the map search + if (routeStore.selectedRouteStops.length > 0) { + await highlightOptimalStopForRoute(); + } } async function updateActiveUnits() { if (!isLoaded.value) return;