Skip to content

Commit 8401a05

Browse files
committed
refactor: remove unused RouteName import and simplify scroll behavior
1 parent 2ca4568 commit 8401a05

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

apps/web/src/router/index.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import { createRouter, createWebHistory, type RouteLocationNormalized, type RouteLocationNormalizedLoaded } from 'vue-router'
55
import { routes } from '@/router/routes'
6-
import { RouteName } from '@/types'
76

87
export const router = createRouter({
98
history: createWebHistory(process.env.BASE_URL),
@@ -13,12 +12,9 @@ export const router = createRouter({
1312
}
1413
if (to.hash) {
1514
return new Promise((resolve) => {
16-
setTimeout(
17-
() => {
18-
resolve({ el: to.hash, behavior: 'instant' })
19-
},
20-
from.name === RouteName.ProgramFromProjectDetail ? 500 : 0
21-
)
15+
setTimeout(() => {
16+
resolve({ el: to.hash, behavior: 'instant' })
17+
}, 0)
2218
})
2319
}
2420
return { top: 0 }

0 commit comments

Comments
 (0)