Skip to content

Commit

Permalink
comment and variable name improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jul 17, 2024
1 parent 11e86ed commit ad6cbeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function getCorrectedAutoReportingFrequency(policy: OnyxInputOrEntry<Policy>): V
}

if (policy?.harvesting?.enabled) {
// this is actually not really "immediate". It's "daily". Surprise!
// This is actually not really "immediate". It's "daily". Surprise!
return CONST.POLICY.AUTO_REPORTING_FREQUENCIES.IMMEDIATE;
}

Expand Down
6 changes: 3 additions & 3 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function deleteWorkspace(policyID: string, policyName: string) {
function setWorkspaceAutoReportingFrequency(policyID: string, frequency: ValueOf<typeof CONST.POLICY.AUTO_REPORTING_FREQUENCIES>) {
const policy = getPolicy(policyID);

const wasPolicyManuallyReported = PolicyUtils.getCorrectedAutoReportingFrequency(policy) === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
const wasPolicyOnManualReporting = PolicyUtils.getCorrectedAutoReportingFrequency(policy) === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;

const optimisticData: OnyxUpdate[] = [
{
Expand All @@ -360,9 +360,9 @@ function setWorkspaceAutoReportingFrequency(policyID: string, frequency: ValueOf
},
}),

// If the policy was manually reported before, and now will be auto-reported,
// If the policy was on manual reporting before, and now will be auto-reported,
// then we must re-enable harvesting
...(wasPolicyManuallyReported &&
...(wasPolicyOnManualReporting &&
frequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL && {
harvesting: {
enabled: true,
Expand Down

0 comments on commit ad6cbeb

Please sign in to comment.