diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue
index 561197a187..4c543cb1bb 100644
--- a/src/components/NavBar.vue
+++ b/src/components/NavBar.vue
@@ -7,6 +7,7 @@ import { useState } from 'src/composables/useState';
import { useStateStore } from 'stores/useStateStore';
import PinnedModules from './PinnedModules.vue';
import { getUrl } from 'src/composables/getUrl';
+import { useRoute } from 'vue-router';
const { t } = useI18n();
const session = useSession();
@@ -14,21 +15,28 @@ const stateStore = useStateStore();
const state = useState();
const user = state.getUser();
const token = session.getToken();
+const route = useRoute();
-onMounted(() => stateStore.setMounted());
+onMounted(() => stateStore. setMounted());
-function redirect() {
+async function redirect() {
const currentURL = window.location.href;
- const routeRegex = /\/#\/(\w+)(?:\/(\d+))?/;
-
+ const routeRegex = /\/(\w+)(?:\/(\d+))?/;
const match = currentURL.match(routeRegex);
- if (match) {
- const [, element, number] = match;
- const redirectURL =
- getUrl() + (number ? `${element}/${number}/summary` : `${element}/index`);
- window.location.href = redirectURL;
+ const [, element, number] = match;
+ console.log(route.path);
+ const section = route.path.substring(route.path.indexOf('/'));
+ console.log(section);
+ if (route?.params?.id) {
+ // const redirectURL =
+ // getUrl() + (number ? `${element}/${number}/summary` : `${element}/index`);
+ // window.location.href = redirectURL;
+ console.log(await getUrl(section));
+ window.location.href = await getUrl(section + route.params);
} else {
- window.location.href = getUrl();
+ console.log(await getUrl(section));
+
+ // window.location.href = await getUrl('claim');
}
}
@@ -80,7 +88,12 @@ function redirect() {
{{ t('globals.pinnedModules') }}
-
+
+
+