Added loops to logs

This commit is contained in:
Emir Karabeg
2025-02-10 15:57:36 -08:00
parent a0b26120b8
commit 3ba2164d64
2 changed files with 5 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ export function initializeStateLogger() {
current: {
blocks: state.blocks,
edges: state.edges,
loops: state.loops,
},
history: {
past: state.history.past,

View File

@@ -40,7 +40,7 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
useWorkflowStore.setState({
blocks,
edges,
loops: loops || {},
loops,
history: history || {
past: [],
present: {
@@ -108,14 +108,15 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
newActiveWorkflowId = remainingIds[0]
const savedState = localStorage.getItem(`workflow-${newActiveWorkflowId}`)
if (savedState) {
const { blocks, edges, history } = JSON.parse(savedState)
const { blocks, edges, history, loops } = JSON.parse(savedState)
useWorkflowStore.setState({
blocks,
edges,
loops,
history: history || {
past: [],
present: {
state: { blocks, edges },
state: { blocks, edges, loops },
timestamp: Date.now(),
action: 'Initial state',
},