diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx index 8ab6930e6c..b98eb7d390 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx @@ -35,7 +35,6 @@ import { getDependsOnFields } from '@/blocks/utils' import { useKnowledgeBase } from '@/hooks/kb/use-knowledge' import { useMcpServers, useMcpToolsQuery } from '@/hooks/queries/mcp' import { useCredentialName } from '@/hooks/queries/oauth-credentials' -import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow' import { useSelectorDisplayName } from '@/hooks/use-selector-display-name' import { useVariablesStore } from '@/stores/panel' import { useWorkflowRegistry } from '@/stores/workflows/registry/store' @@ -613,34 +612,6 @@ export const WorkflowBlock = memo(function WorkflowBlock({ [isDeploying, setDeploymentStatus, refetchDeployment] ) - const { collaborativeSetSubblockValue } = useCollaborativeWorkflow() - - /** - * Clear credential-dependent fields when credential changes to prevent - * stale data from persisting with new credentials. - */ - const prevCredRef = useRef(undefined) - useEffect(() => { - const activeWorkflowId = useWorkflowRegistry.getState().activeWorkflowId - if (!activeWorkflowId) return - const current = useSubBlockStore.getState().workflowValues[activeWorkflowId]?.[id] - if (!current) return - const credValue = current.credential - const cred = - typeof credValue === 'object' && credValue !== null && 'value' in credValue - ? ((credValue as { value?: unknown }).value as string | undefined) - : (credValue as string | undefined) - if (prevCredRef.current !== cred) { - const hadPreviousCredential = prevCredRef.current !== undefined - prevCredRef.current = cred - if (hadPreviousCredential) { - const keys = Object.keys(current) - const dependentKeys = keys.filter((k) => k !== 'credential') - dependentKeys.forEach((k) => collaborativeSetSubblockValue(id, k, '')) - } - } - }, [id, collaborativeSetSubblockValue]) - const currentStoreBlock = currentWorkflow.getBlockById(id) const isStarterBlock = type === 'starter'