mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
Fixed subblock input bug with state
This commit is contained in:
@@ -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],
|
||||
}))
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user