mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
better badges for empty/loading model library folders (#953)
* better badges for empty/loading model library folders for #945 * fix total count on loaded nodes * fix test break * additional test fix * use a null prop fallback instead of having to explicitly calc * patch
This commit is contained in:
committed by
Chenlei Hu
parent
4e5bcd6a3b
commit
d2d645f74b
@@ -82,14 +82,16 @@ const getTreeNodeIcon = (node: TreeExplorerNode) => {
|
||||
}
|
||||
const fillNodeInfo = (node: TreeExplorerNode): RenderedTreeExplorerNode => {
|
||||
const children = node.children?.map(fillNodeInfo)
|
||||
const totalLeaves = node.leaf
|
||||
? 1
|
||||
: children.reduce((acc, child) => acc + child.totalLeaves, 0)
|
||||
return {
|
||||
...node,
|
||||
icon: getTreeNodeIcon(node),
|
||||
children,
|
||||
type: node.leaf ? 'node' : 'folder',
|
||||
totalLeaves: node.leaf
|
||||
? 1
|
||||
: children.reduce((acc, child) => acc + child.totalLeaves, 0)
|
||||
totalLeaves,
|
||||
badgeText: node.getBadgeText ? node.getBadgeText(node) : null
|
||||
}
|
||||
}
|
||||
const onNodeContentClick = async (
|
||||
|
||||
Reference in New Issue
Block a user