Skip to content

Commit

Permalink
Merge pull request #25969 from Expensify/cmartins-addPDFPlaceholder
Browse files Browse the repository at this point in the history
Load generic receipt thumbnail for other file formats
  • Loading branch information
tylerkaraszewski authored Aug 29, 2023
2 parents 17025aa + 44f5a77 commit 3f8f2c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libs/ReceiptUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ function validateReceipt(file) {
* @returns {Object}
*/
function getThumbnailAndImageURIs(path, filename) {
const isReceiptImage = Str.isImage(filename);

// For local files, we won't have a thumbnail yet
if (path.startsWith('blob:') || path.startsWith('file:')) {
if (isReceiptImage && (path.startsWith('blob:') || path.startsWith('file:'))) {
return {thumbnail: null, image: path};
}

const {fileExtension} = FileUtils.splitExtensionFromFileName(filename);
const isReceiptImage = Str.isImage(filename);

if (isReceiptImage) {
return {thumbnail: `${path}.1024.jpg`, image: path};
}

const {fileExtension} = FileUtils.splitExtensionFromFileName(filename);
let image = ReceiptGeneric;
if (fileExtension === CONST.IOU.FILE_TYPES.HTML) {
image = ReceiptHTML;
Expand Down

0 comments on commit 3f8f2c4

Please sign in to comment.