refactor: refs #8185 modified LeftMenu to avoid duplicates
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2024-11-18 06:59:09 +01:00
parent 73c6dcfdd1
commit 2bc219a09b
1 changed files with 3 additions and 1 deletions

View File

@ -22,7 +22,7 @@ const props = defineProps({
default: 'main', default: 'main',
}, },
}); });
const initialized = ref(false);
const items = ref([]); const items = ref([]);
const expansionItemElements = reactive({}); const expansionItemElements = reactive({});
const pinnedModules = computed(() => { const pinnedModules = computed(() => {
@ -53,11 +53,13 @@ const filteredPinnedModules = computed(() => {
onMounted(async () => { onMounted(async () => {
await navigation.fetchPinned(); await navigation.fetchPinned();
getRoutes(); getRoutes();
initialized.value = true;
}); });
watch( watch(
() => route.matched, () => route.matched,
() => { () => {
if (!initialized.value) return;
items.value = []; items.value = [];
getRoutes(); getRoutes();
}, },