Skip to content

Commit

Permalink
Merge pull request #42748 from Expensify/lucien/fix-delayed-submissio…
Browse files Browse the repository at this point in the history
…n-instantly

[Wave Collect] [Workflows] Fix disabling Delayed Submission in NewDot turns off Scheduled Submit instead of setting Instant Submit
  • Loading branch information
rlinoz authored Jun 17, 2024
2 parents cbeecfc + 022c01c commit c4482aa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ function WorkspaceWorkflowsPage({policy, betas, route}: WorkspaceWorkflowsPagePr
subtitle: translate('workflowsPage.delaySubmissionDescription'),
switchAccessibilityLabel: translate('workflowsPage.delaySubmissionDescription'),
onToggle: (isEnabled: boolean) => {
const frequency =
policy?.autoReportingFrequency === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT || !policy?.autoReportingFrequency
? CONST.POLICY.AUTO_REPORTING_FREQUENCIES.WEEKLY
: policy.autoReportingFrequency;
Policy.setWorkspaceAutoReporting(route.params.policyID, isEnabled, frequency);
Policy.setWorkspaceAutoReportingFrequency(
route.params.policyID,
isEnabled ? CONST.POLICY.AUTO_REPORTING_FREQUENCIES.WEEKLY : CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT,
);
},
subMenuItems: (
<MenuItem
Expand Down

0 comments on commit c4482aa

Please sign in to comment.