From fb57f13d62e27e16d9616b204ed6f2c2b083d1e6 Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Mon, 2 Mar 2026 09:35:43 -0500 Subject: [PATCH] fix: recarga total de mapa, corregir 400 bus_stops y flicker de mensaje de buses --- frontend/src/components/map/ArrivalBanner.vue | 2 +- frontend/src/services/busStopsService.ts | 4 ++-- frontend/src/types/index.ts | 2 -- frontend/src/views/MapView.vue | 10 +++------- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/map/ArrivalBanner.vue b/frontend/src/components/map/ArrivalBanner.vue index dcd8fbe..abcf2b5 100644 --- a/frontend/src/components/map/ArrivalBanner.vue +++ b/frontend/src/components/map/ArrivalBanner.vue @@ -13,7 +13,7 @@ {{ hasActiveBuses ? t('map.arrivalTime') : t('common.notice') }} - {{ hasActiveBuses ? stopName : t('map.noBusesAvailable') }} + {{ hasActiveBuses ? stopName : (isLoading ? t('common.loading') : t('map.noBusesAvailable')) }} diff --git a/frontend/src/services/busStopsService.ts b/frontend/src/services/busStopsService.ts index 75b94ac..0bbf679 100644 --- a/frontend/src/services/busStopsService.ts +++ b/frontend/src/services/busStopsService.ts @@ -5,14 +5,14 @@ import type { BusStop, Route } from '@/types' export const busStopsService = { /** Get all bus stops */ async getAllBusStops(): Promise { - const { data, error } = await supabase.from('bus_stops').select('id, name, latitude, longitude, city, address, parent_id, side, stop_type, has_shelter, has_seating, is_accessible, created_at, updated_at') + const { data, error } = await supabase.from('bus_stops').select('id, name, latitude, longitude, city, address, stop_type, has_shelter, has_seating, is_accessible, created_at, updated_at') if (error) throw new Error(error.message) return data as BusStop[] }, /** Get a single bus stop by ID */ async getBusStopById(id: string): Promise { - const { data, error } = await supabase.from('bus_stops').select('id, name, latitude, longitude, city, address, parent_id, side, stop_type, has_shelter, has_seating, is_accessible, created_at, updated_at').eq('id', id).single() + const { data, error } = await supabase.from('bus_stops').select('id, name, latitude, longitude, city, address, stop_type, has_shelter, has_seating, is_accessible, created_at, updated_at').eq('id', id).single() if (error) throw new Error(error.message) return data as BusStop }, diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 1c502ce..b58bb3d 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -27,8 +27,6 @@ export interface BusStop { longitude: number city?: string address?: string - parent_id?: string - side?: string stop_type: StopType has_shelter: boolean has_seating: boolean diff --git a/frontend/src/views/MapView.vue b/frontend/src/views/MapView.vue index 2be1444..c688762 100644 --- a/frontend/src/views/MapView.vue +++ b/frontend/src/views/MapView.vue @@ -74,13 +74,9 @@ function closeUberSearch() { function animateAndReload() { isBannerClosing.value = true; - // Limpiar mapa inmediatamente para feedback visual instantáneo - clearMapMarkers(); - setTimeout(() => { - routeStore.clearSelection(); - isBannerClosing.value = false; - router.replace({ query: {} }); - }, 450); + routeStore.clearSelection(); + // Solución anterior: Recargar para mapa limpio + window.location.href = window.location.origin + window.location.pathname; } function handlePromoClick(promo: any) {