feat(map): clean stop markers and route dimming
This commit is contained in:
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user