File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/components/Attachments/AttachmentView Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -245,8 +245,12 @@ function AttachmentView({
245
245
) ;
246
246
}
247
247
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
+ }
250
254
}
251
255
252
256
// For this check we use both source and file.name since temporary file source is a blob
You can’t perform that action at this time.
0 commit comments