Fix route selection persistence: removed clearSelection from Map and Schedules unmount hooks, ensuring route remains selected when switching views
This commit is contained in:
@ -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();
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user