From 472282a87c2b165bae28ba52fcf8b14903e42329 Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Sat, 18 Jan 2025 22:34:00 -0800 Subject: [PATCH] Fixed subblock input bug with state --- stores/workflow/workflow-store.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stores/workflow/workflow-store.ts b/stores/workflow/workflow-store.ts index 7b133abc79..e0c91d872b 100644 --- a/stores/workflow/workflow-store.ts +++ b/stores/workflow/workflow-store.ts @@ -28,7 +28,7 @@ export const useWorkflowStore = create()( canUndo: () => false, canRedo: () => false, - updateSubBlock: (blockId: string, subBlockId: string, subBlock: SubBlockState) => { + updateSubBlock: (blockId: string, subBlockId: string, value: any) => { set((state) => ({ blocks: { ...state.blocks, @@ -36,11 +36,13 @@ export const useWorkflowStore = create()( ...state.blocks[blockId], subBlocks: { ...state.blocks[blockId].subBlocks, - [subBlockId]: subBlock, + [subBlockId]: { + ...state.blocks[blockId].subBlocks[subBlockId], + value, + }, }, }, }, - edges: [...state.edges], })) },