Skip to content

Commit c8bc9db

Browse files
Adam GoughAdam Gough
authored andcommitted
fix: better detection
1 parent 2784b96 commit c8bc9db

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/sim/app/w/[id]/components/control-bar/control-bar.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ export function ControlBar() {
282282
return
283283
}
284284

285+
// Wait for deployed state to finish loading to avoid race conditions
286+
if (isLoadingDeployedState) {
287+
return
288+
}
289+
285290
// Get current workflow state merged with user inputs
286291
const currentMergedState = mergeSubblockState(currentBlocks, activeWorkflowId)
287292

@@ -295,7 +300,7 @@ export function ControlBar() {
295300
// Simple JSON comparison - if different, changes detected
296301
const hasChanges = JSON.stringify(currentMergedState) !== JSON.stringify(deployedBlocks)
297302
setChangeDetected(hasChanges)
298-
}, [activeWorkflowId, deployedState, currentBlocks, subBlockValues])
303+
}, [activeWorkflowId, deployedState, currentBlocks, subBlockValues, isLoadingDeployedState])
299304

300305
// Check usage limits when component mounts and when user executes a workflow
301306
useEffect(() => {

0 commit comments

Comments
 (0)