File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
apps/sim/stores/terminal/console Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -287,8 +287,6 @@ export const useTerminalConsoleStore = create<ConsoleStore>()(
287287 return entry
288288 }
289289
290- // For loop/parallel iterations, match on iterationCurrent to update the correct entry.
291- // Without this, all iterations of the same block would be updated with the last iteration's output.
292290 if (
293291 typeof update === 'object' &&
294292 update . iterationCurrent !== undefined &&
@@ -411,9 +409,15 @@ export const useTerminalConsoleStore = create<ConsoleStore>()(
411409 } ,
412410 merge : ( persistedState , currentState ) => {
413411 const persisted = persistedState as Partial < ConsoleStore > | undefined
412+ const entries = ( persisted ?. entries ?? currentState . entries ) . map ( ( entry , index ) => {
413+ if ( entry . executionOrder === undefined ) {
414+ return { ...entry , executionOrder : index + 1 }
415+ }
416+ return entry
417+ } )
414418 return {
415419 ...currentState ,
416- entries : persisted ?. entries ?? currentState . entries ,
420+ entries,
417421 isOpen : persisted ?. isOpen ?? currentState . isOpen ,
418422 }
419423 } ,
You can’t perform that action at this time.
0 commit comments