From 93d0109ea5c94cb57b5dc7e7935959a782dfaa75 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sat, 13 Sep 2025 21:55:41 -0700 Subject: [PATCH] [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. --- src/composables/graph/useGraphNodeManager.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/composables/graph/useGraphNodeManager.ts b/src/composables/graph/useGraphNodeManager.ts index 602dbe43e..e91d1f332 100644 --- a/src/composables/graph/useGraphNodeManager.ts +++ b/src/composables/graph/useGraphNodeManager.ts @@ -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