Skip to content

Commit c60bde2

Browse files
cristipavalOSBotify
authored andcommitted
Merge pull request #71006 from Expensify/rodrigo-fix-distance-ereceipt
Fix distance eReceipt in attachment view (cherry picked from commit d43e2d5) (cherry-picked to staging by cristipaval)
1 parent 80ce024 commit c60bde2

File tree

1 file changed

+6
-2
lines changed
  • src/components/Attachments/AttachmentView

1 file changed

+6
-2
lines changed

src/components/Attachments/AttachmentView/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,12 @@ function AttachmentView({
245245
);
246246
}
247247

248-
if (isDistanceRequest(transaction) && !isManualDistanceRequest(transaction) && !hasReceiptSource(transaction) && transaction) {
249-
return <DistanceEReceipt transaction={transaction} />;
248+
if (isDistanceRequest(transaction) && !isManualDistanceRequest(transaction) && transaction) {
249+
// Distance eReceipts are now generated as a PDF, but to keep it backwards compatible we still show the old eReceipt view for image receipts
250+
const isImageReceiptSource = checkIsFileImage(source, file?.name);
251+
if (!hasReceiptSource(transaction) || isImageReceiptSource) {
252+
return <DistanceEReceipt transaction={transaction} />;
253+
}
250254
}
251255

252256
// For this check we use both source and file.name since temporary file source is a blob

0 commit comments

Comments
 (0)