@embedreach/components 0.1.84 → 0.1.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49491,11 +49491,24 @@ const useAutomationSteps = ({
49491
49491
  hideBack: false,
49492
49492
  backDisabled: false,
49493
49493
  nextDisabled: () => {
49494
- return automation2.trigger_metadata?.trigger_type === AutomationTriggerType.ONE_TIME && !(automation2.trigger_metadata?.scheduled_at && new Date(automation2.trigger_metadata?.scheduled_at) > /* @__PURE__ */ new Date() && Boolean(
49494
+ if (!automation2.trigger_metadata) {
49495
+ return true;
49496
+ }
49497
+ if (automation2.trigger_metadata?.trigger_type !== AutomationTriggerType.ONE_TIME) {
49498
+ return false;
49499
+ }
49500
+ if (!automation2.trigger_metadata?.scheduled_at) {
49501
+ return true;
49502
+ }
49503
+ const hasValidSchedule = Boolean(
49504
+ automation2.trigger_metadata?.scheduled_at && new Date(automation2.trigger_metadata.scheduled_at) > /* @__PURE__ */ new Date()
49505
+ );
49506
+ const hasValidCommunicationGroup = Boolean(
49495
49507
  automation2.action_data?.some(
49496
49508
  (action) => action.action_type === "send_communication" && action.action_metadata.communication_group_id
49497
49509
  )
49498
- ));
49510
+ );
49511
+ return !(hasValidSchedule && hasValidCommunicationGroup);
49499
49512
  },
49500
49513
  thirdOptionText: "Save as Draft",
49501
49514
  thirdOptionOnClick: handleSaveAsDraft