Fixed subblock input bug with state

This commit is contained in:
Emir Karabeg
2025-01-18 22:36:40 -08:00
parent f0ac39a438
commit 472282a87c
+5 -3
View File
@@ -28,7 +28,7 @@ export const useWorkflowStore = create<WorkflowStoreWithHistory>()(
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<WorkflowStoreWithHistory>()(
...state.blocks[blockId],
subBlocks: {
...state.blocks[blockId].subBlocks,
[subBlockId]: subBlock,
[subBlockId]: {
...state.blocks[blockId].subBlocks[subBlockId],
value,
},
},
},
},
edges: [...state.edges],
}))
},