mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
fix: deduplicate toolbox count fallback
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
buildToolEntries,
|
||||
buildToolLabel,
|
||||
buildToolSection,
|
||||
countUniqueToolsInList,
|
||||
countUniqueToolsInPanel,
|
||||
FAVORITES_KEYS,
|
||||
filterPanelByToolIds,
|
||||
@@ -180,6 +181,8 @@ const defaultSectionsById = computed<Record<string, ToolPanelItem> | null>(() =>
|
||||
return Object.keys(validSections).length > 0 ? validSections : null;
|
||||
});
|
||||
|
||||
const myToolsDefaultSectionsById = computed(() => defaultSectionsById.value || localSectionsById.value);
|
||||
|
||||
// Use composable for favorites and recent tools — we only need the bits that
|
||||
// drive the search-results split (favorites get their own section in mixed
|
||||
// results). The full My-Tools landing state lives inside `MyToolsLanding.vue`.
|
||||
@@ -189,7 +192,10 @@ const { favoritesCollapsed, favoriteToolIdSet, recentToolIdsToShowSet } = useToo
|
||||
const { favoriteResults, nonFavoriteResults, hasMixedResults } = useFavoriteSearchResults(results, favoriteToolIdSet);
|
||||
|
||||
const toolsCount = computed(() =>
|
||||
countUniqueToolsInPanel(defaultSectionsById.value || localSectionsById.value, toolsList.value.length),
|
||||
countUniqueToolsInPanel(
|
||||
defaultSectionsById.value || localSectionsById.value,
|
||||
countUniqueToolsInList(toolsList.value),
|
||||
),
|
||||
);
|
||||
|
||||
const resultsSet = computed(() => new Set(results.value));
|
||||
@@ -436,7 +442,7 @@ function onLabelToggle(labelId: string) {
|
||||
<MyToolsLanding
|
||||
v-if="showMyToolsLanding"
|
||||
:local-tools-by-id="localToolsById"
|
||||
:default-sections-by-id="defaultSectionsById"
|
||||
:default-sections-by-id="myToolsDefaultSectionsById"
|
||||
:local-sections-by-id="localSectionsById"
|
||||
:tools-count="toolsCount"
|
||||
@onClick="onToolClick"
|
||||
|
||||
Reference in New Issue
Block a user