fix: condensing logic

This commit is contained in:
Adam Gough
2025-05-29 22:33:19 -07:00
parent 01881d0db4
commit 6946db9eb6
2 changed files with 9 additions and 8 deletions

View File

@@ -199,13 +199,7 @@ export function ControlBar() {
* This is the single source of truth for deployed workflow state
*/
const fetchDeployedState = async () => {
if (!activeWorkflowId) {
setDeployedState(null)
return
}
// Skip fetching if not deployed
if (!isDeployed) {
if (!activeWorkflowId || !isDeployed) {
setDeployedState(null)
return
}

View File

@@ -45,7 +45,6 @@ export function WorkflowBlock({ id, data }: NodeProps<WorkflowBlockProps>) {
isDisabled?: boolean
id?: string
} | null>(null)
const [isLoadingWebhookInfo, setIsLoadingWebhookInfo] = useState(false)
const [webhookInfo, setWebhookInfo] = useState<{
webhookPath: string
provider: string
@@ -170,6 +169,14 @@ export function WorkflowBlock({ id, data }: NodeProps<WorkflowBlockProps>) {
}
}
useEffect(() => {
if (type === 'starter') {
fetchScheduleInfo()
} else {
setScheduleInfo(null)
}
}, [type])
// Get webhook information for the tooltip
useEffect(() => {
if (type === 'starter' && hasActiveWebhook) {