mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 15:38:00 -05:00
fix: condensing logic
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user