Skip to content

Commit 54239bb

Browse files
committed
chore: refactor code
1 parent 6593ea9 commit 54239bb

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/components/MoneyRequestConfirmationListFooter.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,6 @@ function MoneyRequestConfirmationListFooter({
332332
// Determine if the merchant error should be displayed
333333
const shouldDisplayMerchantError = isMerchantRequired && (shouldDisplayFieldError || formError === 'iou.error.invalidMerchant') && isMerchantEmpty;
334334
const shouldDisplayDistanceRateError = formError === 'iou.error.invalidRate';
335-
// Determine when to show the receipt empty state:
336-
// - Show for submit or track expense types
337-
// - Hide for per diem requests
338-
// - Hide when submitting a track expense to a non-paid group policy (personal users)
339335
const showReceiptEmptyState = shouldShowReceiptEmptyState(iouType, action, policy, isPerDiemRequest);
340336
// The per diem custom unit
341337
const perDiemCustomUnit = getPerDiemCustomUnit(policy);

src/libs/IOUUtils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ function isMovingTransactionFromTrackExpense(action?: IOUAction) {
186186
}
187187

188188
function shouldShowReceiptEmptyState(iouType: IOUType, action: IOUAction, policy: OnyxInputOrEntry<Policy> | SearchPolicy, isPerDiemRequest: boolean) {
189+
// Determine when to show the receipt empty state:
190+
// - Show for submit or track expense types
191+
// - Hide for per diem requests
192+
// - Hide when submitting a track expense to a non-paid group policy (personal users)
189193
return (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.TRACK) && !isPerDiemRequest && (!isMovingTransactionFromTrackExpense(action) || isPaidGroupPolicy(policy));
190194
}
191195

0 commit comments

Comments
 (0)