diff --git a/web/app/components/workflow/store/workflow/debug/inspect-vars-slice.ts b/web/app/components/workflow/store/workflow/debug/inspect-vars-slice.ts index 8b7d880a6d..8140280b61 100644 --- a/web/app/components/workflow/store/workflow/debug/inspect-vars-slice.ts +++ b/web/app/components/workflow/store/workflow/debug/inspect-vars-slice.ts @@ -86,8 +86,8 @@ export const createInspectVarsSlice: StateCreator = (set, }, renameInspectVarName: (nodeId, varId, selector) => { set((state: InspectVarsSliceShape) => { - const newData = produce(state, (draft) => { - const targetNode = draft.nodesWithInspectVars.find(node => node.nodeId === nodeId) + const nodes = produce(state.nodesWithInspectVars, (draft) => { + const targetNode = draft.find(node => node.nodeId === nodeId) if (!targetNode) return const targetVar = targetNode.vars.find(varItem => varItem.id === varId) @@ -98,7 +98,7 @@ export const createInspectVarsSlice: StateCreator = (set, }, ) return { - nodesWithInspectVars: newData.nodesWithInspectVars, + nodesWithInspectVars: nodes, } }) },