From 91d0c1251456c1dd80c61e1d35e130be2a20adf3 Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Mon, 2 Mar 2026 14:11:53 -0500 Subject: [PATCH] =?UTF-8?q?Sincronizaci=C3=B3n=20final:=20MapView.vue=20co?= =?UTF-8?q?n=20fixes=20de=20reset,=20apertura=20autom=C3=A1tica=20y=20deci?= =?UTF-8?q?males?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/MapView.vue | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/frontend/src/views/MapView.vue b/frontend/src/views/MapView.vue index 1d97fe6..9a9bbb1 100644 --- a/frontend/src/views/MapView.vue +++ b/frontend/src/views/MapView.vue @@ -21,7 +21,7 @@ import SearchOverlay from "@/components/map/SearchOverlay.vue"; import PromoCarousel from "@/components/map/PromoCarousel.vue"; import ArrivalBanner from "@/components/map/ArrivalBanner.vue"; -const ETACard = defineAsyncComponent(() => import("@/components/ETACard.vue")); +const ETACard = defineAsyncComponent(() => import("@/components/map/ETACard.vue")); import type { BusStop } from '@/types' const router = useRouter(); @@ -413,35 +413,33 @@ watch([etaCargando, () => busesActivos.value.length], ([loading, count]) => { */ function handleBannerClick() { + // Solo abrir el ETACard, NO borrar paradas ni ruta showETACard.value = true; - // Desaparecer las paradas: - routeStore.clearSelection(); - router.replace({ query: {} }); - clearMapMarkers(); } // Watch for route selection changes watch(() => routeStore.selectedRouteId, (routeId) => { if (routeId) { if (routeStore.wasSelectedFromMap) { - // OPTIMIZACIÓN PROBLEMA 1: Paralelismo Total - // Iniciamos dibujo y búsqueda de disponibilidad en paralelo + // Iniciar dibujo y búsqueda de disponibilidad en paralelo + // ETACard se abrirá cuando paradaCercana sea calculada (ver watcher abajo) + showETACard.value = false; updateMapMarkers(false); updateActiveUnits(); - showETACard.value = true; // RESTORED: Abrir automáticamente al seleccionar ruta } else { clearMapMarkers(); } } else { clearMapMarkers(); - // showETACard.value = false; // REVERTED: Mantener ETACard abierta aunque se limpie el mapa (petición de usuario) } }); // Watch for paradaCercana to recalculate ETA as soon as it's identified +// Y abrir el ETACard automáticamente cuando ya tenemos la parada watch(paradaCercana, (newStop) => { if (newStop && routeStore.selectedRouteId) { updateActiveUnits(); + showETACard.value = true; // Abrir ahora que sí tenemos datos reales } }); @@ -572,7 +570,7 @@ watch([() => authStore.userProfile?.auto_location, isLoaded], ([canLocate, loade :walk-duration="duracionCaminata" :buses="busesActivos" :is-loading="etaCargando" - @close="showETACard = false" + @close="animateAndReload" @refresh="paradaCercana && routeStore.selectedRouteId ? calcularETA(routeStore.selectedRouteId, paradaCercana) : null" />