Skip to content

Commit

Permalink
Merge pull request Expensify#50537 from mkzie2/mkzie2-issue/50334
Browse files Browse the repository at this point in the history
Migrate `IOURequestStepDistanceRate` to `useOnyx`
  • Loading branch information
neil-marcellini authored Oct 16, 2024
2 parents 0aad704 + 7170d67 commit cbd4f17
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ function IOURequestStepDistanceRate({
transaction,
}: IOURequestStepDistanceRateProps) {
const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${IOU.getIOURequestPolicyID(transaction, reportDraft) ?? '-1'}`);
const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report ? report.policyID : '-1'}`);
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report ? report.policyID : '0'}`);
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${report ? report.policyID : '0'}`);
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID || '-1'}`);
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report?.policyID || '-1'}`);
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${report?.policyID || '-1'}`);
/* eslint-enable @typescript-eslint/prefer-nullish-coalescing */

const policy = policyReal ?? policyDraft;

Expand Down

0 comments on commit cbd4f17

Please sign in to comment.