Fix route selection persistence: removed clearSelection from Map and Schedules unmount hooks, ensuring route remains selected when switching views

This commit is contained in:
2026-03-01 12:23:25 -05:00
parent a092df33f7
commit 102abc22ef
2 changed files with 3 additions and 4 deletions

View File

@ -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();

View File

@ -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()
})
</script>