|
1 | 1 | import "iconify-icon"; |
2 | 2 | import {onMounted} from "vue"; |
3 | | -import type {RouteLocationNormalized} from "vue-router"; |
4 | | -import {defineClientConfig, useRoute} from 'vuepress/client'; |
| 3 | +import type {RouteLocation, RouteLocationNormalized} from "vue-router"; |
| 4 | +import {defineClientConfig} from 'vuepress/client'; |
5 | 5 | import CloudBanner from "./components/CloudBanner.vue"; |
6 | 6 | import ClientsGrid from "./components/ClientsGrid.vue"; |
7 | 7 | import KapaWidget from './components/KapaWidget.vue'; |
@@ -50,14 +50,6 @@ const findEsMeta = (route: RouteLocationNormalized) => { |
50 | 50 |
|
51 | 51 | const removeHtml = (path: string) => path.replace(".html", ""); |
52 | 52 |
|
53 | | -const reload = () => { |
54 | | - if (typeof window !== "undefined") { |
55 | | - setTimeout(() => { |
56 | | - window.location.reload() |
57 | | - }, 200); |
58 | | - } |
59 | | -} |
60 | | - |
61 | 53 | let cookiebotListenerRegistered = false; |
62 | 54 |
|
63 | 55 |
|
@@ -143,18 +135,12 @@ export default defineClientConfig({ |
143 | 135 | app.component("KapaWidget", KapaWidget); |
144 | 136 | app.component("UserFeedback", UserFeedback); |
145 | 137 | const addFixedRoute = (from: string, to: string) => router.addRoute({ |
146 | | - path: from, redirect: _ => { |
147 | | - reload(); |
148 | | - return to; |
149 | | - } |
| 138 | + path: from, redirect: to |
150 | 139 | }); |
151 | | - const addDynamicRoute = (from: string, calc: ((to: RouteLocationNormalized) => string)) => |
| 140 | + const addDynamicRoute = (from: string, calc: ((to: RouteLocation) => string)) => |
152 | 141 | router.addRoute({ |
153 | 142 | path: from, |
154 | | - redirect: to => { |
155 | | - reload(); |
156 | | - return calc(to); |
157 | | - } |
| 143 | + redirect: to => calc(to) |
158 | 144 | }); |
159 | 145 |
|
160 | 146 | // Router configuration |
|
0 commit comments