From ec1137b2c206615135ad294e7eab64029a527b27 Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Sat, 28 Feb 2026 21:30:35 -0500 Subject: [PATCH] fix: closest stop only marked when using map search flow --- frontend/src/views/MapView.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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;