Optimize route clearing: replaced full page reload with store clearing and URL cleanup when closing the map banner
This commit is contained in:
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user