fix: respect localePath on router - fixed #1859

This commit is contained in:
liyasthomas 2021-10-06 12:38:50 +05:30
parent 3604d69463
commit 5772117dc8

View File

@ -108,21 +108,22 @@ function updateThemes() {
function defineJumpActions() { function defineJumpActions() {
const router = useRouter() const router = useRouter()
const { localePath } = useContext() as any
defineActionHandler("navigation.jump.rest", () => { defineActionHandler("navigation.jump.rest", () => {
router.push({ path: "/" }) router.push({ path: localePath("/") })
}) })
defineActionHandler("navigation.jump.graphql", () => { defineActionHandler("navigation.jump.graphql", () => {
router.push({ path: "/graphql" }) router.push({ path: localePath("/graphql") })
}) })
defineActionHandler("navigation.jump.realtime", () => { defineActionHandler("navigation.jump.realtime", () => {
router.push({ path: "/realtime" }) router.push({ path: localePath("/realtime") })
}) })
defineActionHandler("navigation.jump.documentation", () => { defineActionHandler("navigation.jump.documentation", () => {
router.push({ path: "/documentation" }) router.push({ path: localePath("/documentation") })
}) })
defineActionHandler("navigation.jump.settings", () => { defineActionHandler("navigation.jump.settings", () => {
router.push({ path: "/settings" }) router.push({ path: localePath("/settings") })
}) })
defineActionHandler("navigation.jump.back", () => { defineActionHandler("navigation.jump.back", () => {
router.go(-1) router.go(-1)