Skip to content

The open alternative to Salesforce, designed for AI.

Fix workflow activate last version (#9243)

Raphaël Bosi68d47e954330
diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/hooks/useActivateLastPublishedVersionWorkflowSingleRecordAction.ts b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/hooks/useActivateLastPublishedVersionWorkflowSingleRecordAction.ts
index 32f84f6736c..0c68e1a629d 100644
--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/hooks/useActivateLastPublishedVersionWorkflowSingleRecordAction.ts
+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/hooks/useActivateLastPublishedVersionWorkflowSingleRecordAction.ts
@@ -13,7 +13,8 @@ export const useActivateLastPublishedVersionWorkflowSingleRecordAction: SingleRe
isDefined(workflowWithCurrentVersion) &&
isDefined(workflowWithCurrentVersion.currentVersion.trigger) &&
isDefined(workflowWithCurrentVersion.lastPublishedVersionId) &&
- workflowWithCurrentVersion.currentVersion.status !== 'ACTIVE' &&
+ workflowWithCurrentVersion.lastPublishedVersionId !== '' &&
+ !workflowWithCurrentVersion.statuses?.includes('ACTIVE') &&
isDefined(workflowWithCurrentVersion.currentVersion?.steps) &&
workflowWithCurrentVersion.currentVersion?.steps.length !== 0;