Skip to content

Commit

Permalink
fix: blank receipt holder when delete expense offline
Browse files Browse the repository at this point in the history
  • Loading branch information
gijoe0295 committed Dec 12, 2024
1 parent 05b22e3 commit 0c4798f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,14 @@ function MoneyRequestPreviewContent({
!onPreviewPressed ? [styles.moneyRequestPreviewBox, containerStyles] : {},
]}
>
<ReportActionItemImages
images={receiptImages}
isHovered={isHovered || isScanning}
size={1}
onPress={shouldDisableOnPress ? undefined : onPreviewPressed}
/>
{!isDeleted && (
<ReportActionItemImages
images={receiptImages}
isHovered={isHovered || isScanning}
size={1}
onPress={shouldDisableOnPress ? undefined : onPreviewPressed}
/>
)}
{isEmptyObject(transaction) && !ReportActionsUtils.isMessageDeleted(action) && action.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? (
<MoneyRequestSkeletonView />
) : (
Expand Down
15 changes: 9 additions & 6 deletions src/components/ReportActionItem/ReportPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ function ReportPreview({
ReportUtils.hasActionsWithErrors(iouReportID);
const lastThreeTransactions = allTransactions.slice(-3);
const lastThreeReceipts = lastThreeTransactions.map((transaction) => ({...ReceiptUtils.getThumbnailAndImageURIs(transaction), transaction}));
console.log(allTransactions);

Check failure on line 178 in src/components/ReportActionItem/ReportPreview.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unexpected console statement
const showRTERViolationMessage =
numberOfRequests === 1 &&
TransactionUtils.hasPendingUI(allTransactions.at(0), TransactionUtils.getTransactionViolations(allTransactions.at(0)?.transactionID ?? '-1', transactionViolations));
Expand Down Expand Up @@ -472,12 +473,14 @@ function ReportPreview({
accessibilityLabel={translate('iou.viewDetails')}
>
<View style={[styles.reportPreviewBox, isHovered || isScanning || isWhisper ? styles.reportPreviewBoxHoverBorder : undefined]}>
<ReportActionItemImages
images={lastThreeReceipts}
total={allTransactions.length}
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
onPress={openReportFromPreview}
/>
{lastThreeReceipts.length > 0 && (
<ReportActionItemImages
images={lastThreeReceipts}
total={allTransactions.length}
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
onPress={openReportFromPreview}
/>
)}
<View style={[styles.expenseAndReportPreviewBoxBody, hasReceipts ? styles.mtn1 : {}]}>
<View style={shouldShowSettlementButton ? {} : styles.expenseAndReportPreviewTextButtonContainer}>
<View style={styles.expenseAndReportPreviewTextContainer}>
Expand Down

0 comments on commit 0c4798f

Please sign in to comment.