[refactor] extract node type resolution to named const - addresses @DrJKL's readability concern

Extracted the multi-fallback type resolution logic into a clearly named
variable for improved readability and maintainability.
This commit is contained in:
bymyself
2025-09-13 21:55:41 -07:00
parent a3d91cd5fc
commit 93d0109ea5

View File

@@ -202,15 +202,17 @@ export const useGraphNodeManager = (graph: LGraph): GraphNodeManager => {
}
})
const nodeType =
node.type ||
node.constructor?.comfyClass ||
node.constructor?.title ||
node.constructor?.name ||
'Unknown'
return {
id: String(node.id),
title: typeof node.title === 'string' ? node.title : '',
type:
node.type ||
node.constructor?.comfyClass ||
node.constructor?.title ||
node.constructor?.name ||
'Unknown',
type: nodeType,
mode: node.mode || 0,
selected: node.selected || false,
executing: false, // Will be updated separately based on execution state