From 860f92cb42ef164056c37b0aee067bc4e1bd3ebe Mon Sep 17 00:00:00 2001 From: provira Date: Thu, 30 Jan 2025 13:51:12 +0100 Subject: [PATCH] fix: refs #8410 simplified searchModule function --- src/components/LeftMenu.vue | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 0385ec4d7..41f9be74f 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -25,7 +25,6 @@ const props = defineProps({ }); const initialized = ref(false); const items = ref([]); -const searchingValue = false; const expansionItemElements = reactive({}); const pinnedModules = computed(() => { const map = new Map(); @@ -177,17 +176,9 @@ function normalize(text) { .toLowerCase(); } const searchModule = () => { - const searching = ref(false); - items.value.some((item) => { - const title = normalize(t(item.title)); - if (title.includes(search.value.toLowerCase()) && !searching.value) { - searching.value = true; - router.push({ name: item.name }); - return true; - } - return false; - }); -} + const [item] = filteredItems.value; + if (item) router.push({ name: item.name }); +};