diff --git a/frontend/src/views/MapView.vue b/frontend/src/views/MapView.vue index 9be281c..ddaf11c 100644 --- a/frontend/src/views/MapView.vue +++ b/frontend/src/views/MapView.vue @@ -209,8 +209,6 @@ function prevPromo() { onUnmounted(() => { if (unitFetchInterval.value) clearInterval(unitFetchInterval.value); if (carouselTimer.value) clearInterval(carouselTimer.value); - // Limpiamos la selección al salir para que no afecte a la sección de Horarios - routeStore.clearSelection(); // Clear all markers when component unmounts clearMapMarkers(); diff --git a/frontend/src/views/SchedulesView.vue b/frontend/src/views/SchedulesView.vue index e11f968..dbf7ffb 100644 --- a/frontend/src/views/SchedulesView.vue +++ b/frontend/src/views/SchedulesView.vue @@ -145,6 +145,9 @@ onMounted(async () => { if (queryRouteId) { const found = routeStore.allRoutes.find(r => r.id === queryRouteId) if (found) pickRoute(found.id, found.name) + } else if (routeStore.selectedRouteId) { + // SIBU | Si venimos de otra vista (Mapa) con una ruta, cargamos sus horarios + scheduleStore.loadRouteSchedules(routeStore.selectedRouteId) } }) @@ -161,8 +164,6 @@ const stopWatch = watch( onUnmounted(() => { stopWatch() document.removeEventListener('click', handleOutsideClick) - // Limpiamos la selección al salir para que no aparezca marcada en el buscador del mapa - routeStore.clearSelection() })