mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-07 22:33:57 -05:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user