diff --git a/src/components/UserMenu.vue b/src/components/UserMenu.vue
index 833238b..f5c7e6b 100644
--- a/src/components/UserMenu.vue
+++ b/src/components/UserMenu.vue
@@ -21,7 +21,7 @@
diff --git a/src/stores/admin/navigation.ts b/src/stores/admin/navigation.ts
index 7cd4604..e5add0b 100644
--- a/src/stores/admin/navigation.ts
+++ b/src/stores/admin/navigation.ts
@@ -46,7 +46,7 @@ export const useNavigationStore = defineStore("navigation", {
resetNavigation() {
this.$reset();
},
- updateTopLevel(first: boolean = false) {
+ updateTopLevel() {
const abilityStore = useAbilityStore();
this.topLevel = [
...(abilityStore.canSection("read", "club")
@@ -82,7 +82,7 @@ export const useNavigationStore = defineStore("navigation", {
router.push({ name: `admin-${this.topLevel[0]?.key ?? "club"}-default` });
}
},
- updateNavigation(first: boolean = false) {
+ updateNavigation() {
const abilityStore = useAbilityStore();
this.navigation = {
club: {
@@ -129,8 +129,12 @@ export const useNavigationStore = defineStore("navigation", {
],
},
} as navigationModel;
- if (this.activeNavigationObject.main.findIndex((e) => e.key == this.activeLink) == -1) {
- router.push({ name: `admin-${this.activeNavigation}-default` });
+ if (
+ this.activeNavigationObject.main.findIndex((e) => e.key == this.activeLink) == -1 ||
+ this.activeLink == "default"
+ ) {
+ let link = this.activeNavigationObject.main[0].key;
+ router.push({ name: `admin-${this.activeNavigation}-${link}` });
}
},
},
diff --git a/src/views/admin/View.vue b/src/views/admin/View.vue
index 8d1781b..6a22f18 100644
--- a/src/views/admin/View.vue
+++ b/src/views/admin/View.vue
@@ -58,8 +58,8 @@ export default defineComponent({
this.updateTopLevel();
this.updateNavigation();
});
- this.updateTopLevel(true);
- this.updateNavigation(true);
+ this.updateTopLevel();
+ this.updateNavigation();
},
beforeUnmount() {
this.resetNavigation();