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(() => {
|
onUnmounted(() => {
|
||||||
if (unitFetchInterval.value) clearInterval(unitFetchInterval.value);
|
if (unitFetchInterval.value) clearInterval(unitFetchInterval.value);
|
||||||
if (carouselTimer.value) clearInterval(carouselTimer.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
|
// Clear all markers when component unmounts
|
||||||
clearMapMarkers();
|
clearMapMarkers();
|
||||||
|
|
||||||
|
|||||||
@ -145,6 +145,9 @@ onMounted(async () => {
|
|||||||
if (queryRouteId) {
|
if (queryRouteId) {
|
||||||
const found = routeStore.allRoutes.find(r => r.id === queryRouteId)
|
const found = routeStore.allRoutes.find(r => r.id === queryRouteId)
|
||||||
if (found) pickRoute(found.id, found.name)
|
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(() => {
|
onUnmounted(() => {
|
||||||
stopWatch()
|
stopWatch()
|
||||||
document.removeEventListener('click', handleOutsideClick)
|
document.removeEventListener('click', handleOutsideClick)
|
||||||
// Limpiamos la selección al salir para que no aparezca marcada en el buscador del mapa
|
|
||||||
routeStore.clearSelection()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user