Optimize route clearing: replaced full page reload with store clearing and URL cleanup when closing the map banner

This commit is contained in:
2026-03-01 12:30:24 -05:00
parent 102abc22ef
commit b8577a512b

View File

@ -92,9 +92,6 @@ function closeUberSearch() {
// Modal state removed per request (no more stop markers to click) // Modal state removed per request (no more stop markers to click)
function reloadPage() {
window.location.reload();
}
const showPromoModal = ref(false); const showPromoModal = ref(false);
const selectedPromo = ref<any>(null); const selectedPromo = ref<any>(null);
@ -103,7 +100,10 @@ const isBannerClosing = ref(false);
function animateAndReload() { function animateAndReload() {
isBannerClosing.value = true; isBannerClosing.value = true;
setTimeout(() => { setTimeout(() => {
reloadPage(); routeStore.clearSelection();
isBannerClosing.value = false;
// Limpiamos los parámetros de la URL para que no vuelva a cargar la ruta al recargar
router.replace({ query: {} });
}, 450); // Mismo tiempo que la transición }, 450); // Mismo tiempo que la transición
} }