refactor(frontend): simplify edge data handling in useEdgeStore

Updated the edgeStore to streamline the retrieval of input values. The logic now checks for the existence of the target handle in the execution result's input data, improving readability and ensuring that bead data is only set when the input value is defined and not null.
This commit is contained in:
abhi1992002
2026-01-05 12:44:38 +05:30
parent 587c562dad
commit 7ce203a8d5

View File

@@ -115,10 +115,11 @@ export const useEdgeStore = create<EdgeStore>((set, get) => ({
edge.data?.beadData ??
new Map<string, NodeExecutionResult["status"]>();
if (
edge.targetHandle &&
edge.targetHandle in executionResult.input_data
) {
const inputValue = edge.targetHandle
? executionResult.input_data[edge.targetHandle]
: undefined;
if (inputValue !== undefined && inputValue !== null) {
beadData.set(executionResult.node_exec_id, executionResult.status);
}