mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
Amp-Thread-ID: https://ampcode.com/threads/T-019cbfdf-bf82-76de-b36c-91758530a0ce Co-authored-by: Amp <amp@ampcode.com>
21 lines
633 B
TypeScript
21 lines
633 B
TypeScript
import type { SubgraphNode } from '@/lib/litegraph/src/subgraph/SubgraphNode'
|
|
import { usePromotionStore } from '@/stores/promotionStore'
|
|
|
|
export function hasUnpromotedWidgets(subgraphNode: SubgraphNode): boolean {
|
|
const promotionStore = usePromotionStore()
|
|
const { id: subgraphNodeId, rootGraph, subgraph } = subgraphNode
|
|
|
|
return subgraph.nodes.some((interiorNode) =>
|
|
(interiorNode.widgets ?? []).some(
|
|
(widget) =>
|
|
!widget.computedDisabled &&
|
|
!promotionStore.isPromoted(
|
|
rootGraph.id,
|
|
subgraphNodeId,
|
|
String(interiorNode.id),
|
|
widget.name
|
|
)
|
|
)
|
|
)
|
|
}
|