Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function IOURequestStepUpgrade({
const [allReportNextSteps] = useOnyx(ONYXKEYS.COLLECTION.NEXT_STEP);
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const [session] = useOnyx(ONYXKEYS.SESSION);
const [allPolicyTags] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang, is this subscription really needed in this case? I mean, we can add it for now to fix typecheck, but it sucks to add another full-collection subscription if it's not always needed.


// Build transactions map from selectedTransactions (search results) instead of Onyx TRANSACTION collection
// This ensures that transactions selected from search are properly included in the map passed to changeTransactionsReport
Expand Down Expand Up @@ -132,6 +133,7 @@ function IOURequestStepUpgrade({
const optimisticReport = createNewReport(ownerPersonalDetails, hasViolations, isASAPSubmitBetaEnabled, newPolicy, betas);

const reportNextStep = allReportNextSteps?.[`${ONYXKEYS.COLLECTION.NEXT_STEP}${optimisticReport.reportID}`];
const policyTagList = policyID ? allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] : {};

// Move ALL selected transactions to the new report
changeTransactionsReport({
Expand All @@ -144,6 +146,7 @@ function IOURequestStepUpgrade({
reportNextStep,
policyCategories: allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`],
allTransactions,
policyTagList,
});

clearSelectedTransactions();
Expand Down Expand Up @@ -229,6 +232,7 @@ function IOURequestStepUpgrade({
betas,
iouType,
isTrack,
allPolicyTags,
]);

const participant = transaction?.participants?.[0];
Expand Down
Loading