Skip to content

Commit

Permalink
Hide empty folders when searching in model library (#1382)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Oct 30, 2024
1 parent bf7a9bf commit e48c785
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/sidebar/tabs/ModelLibrarySidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ const handleSearch = async (query: string) => {
type ModelOrFolder = ComfyModelDef | ModelFolder
const root = computed<TreeNode>(() => {
const allNodes: ModelOrFolder[] = [
...modelStore.modelFolders,
...(searchQuery.value ? filteredModels.value : modelStore.models)
]
const allNodes: ModelOrFolder[] = searchQuery.value
? filteredModels.value
: [...modelStore.modelFolders, ...modelStore.models]
return buildTree(allNodes, (modelOrFolder: ModelOrFolder) =>
modelOrFolder.key.split('/')
)
Expand Down

0 comments on commit e48c785

Please sign in to comment.