fix: closest stop only marked when using map search flow

This commit is contained in:
2026-02-28 21:30:35 -05:00
parent 2eca01d7ed
commit ec1137b2c2

View File

@ -301,11 +301,6 @@ watch(
newStops.some((stop, idx) => stop.id !== oldStops[idx]?.id)) { newStops.some((stop, idx) => stop.id !== oldStops[idx]?.id)) {
console.log('Route stops changed - updating markers') console.log('Route stops changed - updating markers')
// FLOW REFINEMENT: Find the optimal entrance stop first
if (newStops.length > 0) {
await highlightOptimalStopForRoute();
}
await updateMapMarkers(); 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}`); console.log(`🤖 JARVIS: Iniciando viaje hacia ${routeName}`);
routeStore.selectRoute(routeId, routeName); await routeStore.selectRoute(routeId, routeName);
showRouteDropdown.value = false; showRouteDropdown.value = false;
showUberSearch.value = false; // Close the expanded search panel 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() { async function updateActiveUnits() {
if (!isLoaded.value) return; if (!isLoaded.value) return;