feat(map): clean stop markers and route dimming

This commit is contained in:
2026-02-26 22:05:55 -05:00
parent 1f0229461b
commit c9a260ab23
7 changed files with 535 additions and 363 deletions

View File

@ -14,16 +14,24 @@ const navItems = [
{ name: 'taxi', path: '/taxi', icon: 'directions_bus' }
]
let isNavigating = false
const isNavigating = ref(false)
const navigateTo = (path: string) => {
const navigateTo = async (path: string) => {
// Prevent rapid multiple navigations (debounce guard)
if (isNavigating) return
if (isNavigating.value) return
if (route.path === path) return
isNavigating = true
router.push(path).finally(() => {
setTimeout(() => { isNavigating = false }, 300)
})
try {
isNavigating.value = true
await router.push(path)
} catch (e: any) {
if (e?.name !== 'NavigationDuplicated') {
console.error('SIBU | Error de navegación en el menú inferior:', e)
}
} finally {
// Add a small delay to prevent rapid double-taps
setTimeout(() => { isNavigating.value = false }, 300)
}
}
const isActive = (path: string) => {
@ -59,8 +67,9 @@ onUnmounted(() => {
v-for="item in navItems"
:key="item.name"
class="nav-item"
:class="{ active: isActive(item.path) }"
@click="navigateTo(item.path)"
:class="{ active: isActive(item.path), 'opacity-50 pointer-events-none': isNavigating }"
@click.prevent="navigateTo(item.path)"
@touchend.prevent="navigateTo(item.path)"
>
<span class="material-icons">{{ item.icon }}</span>
<span class="nav-label">{{ t('navigation.' + item.name) }}</span>