Sincronización final: MapView.vue con fixes de reset, apertura automática y decimales
This commit is contained in:
@ -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"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user