Skip to content

Commit 71e604e

Browse files
committed
fix(deploy): skip expensive state merge when deployedState is null
Avoid running mergeSubblockStateWithValues on every render for non-deployed workflows where changeDetected always returns false.
1 parent 9a348c8 commit 71e604e

File tree

1 file changed

+2
-1
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks

1 file changed

+2
-1
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-change-detection.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function useChangeDetection({
9898
const needsClientFallback = serverNeedsRedeployment === undefined && !isServerLoading
9999

100100
const currentState = useMemo((): WorkflowState | null => {
101-
if (!needsClientFallback || !workflowId) return null
101+
if (!needsClientFallback || !workflowId || !deployedState) return null
102102

103103
const mergedBlocks = mergeSubblockStateWithValues(blocks, subBlockValues ?? {})
104104

@@ -112,6 +112,7 @@ export function useChangeDetection({
112112
}, [
113113
needsClientFallback,
114114
workflowId,
115+
deployedState,
115116
blocks,
116117
edges,
117118
loops,

0 commit comments

Comments
 (0)