File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
apps/sim/stores/workflows Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,24 @@ export async function fetchWorkflowsFromDB(): Promise<void> {
285285 } )
286286 } )
287287
288+ // Get any additional subblock values that might not be in the state but are in the store
289+ const storedValues = useSubBlockStore . getState ( ) . workflowValues [ id ] || { }
290+ Object . entries ( storedValues ) . forEach ( ( [ blockId , blockValues ] ) => {
291+ if ( ! subblockValues [ blockId ] ) {
292+ subblockValues [ blockId ] = { }
293+ }
294+
295+ Object . entries ( blockValues ) . forEach ( ( [ subblockId , value ] ) => {
296+ // Only update if not already set or if value is null
297+ if (
298+ subblockValues [ blockId ] [ subblockId ] === null ||
299+ subblockValues [ blockId ] [ subblockId ] === undefined
300+ ) {
301+ subblockValues [ blockId ] [ subblockId ] = value
302+ }
303+ } )
304+ } )
305+
288306 // 4. Store the workflow state and subblock values in localStorage
289307 // This ensures compatibility with existing code that loads from localStorage
290308 localStorage . setItem ( `workflow-${ id } ` , JSON . stringify ( workflowState ) )
You can’t perform that action at this time.
0 commit comments