Skip to content

Commit

Permalink
change order of thumbnail logic
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Aug 25, 2023
1 parent f48a208 commit 9bc9c3a
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 ((path.startsWith('blob:') || path.startsWith('file:')) && isReceiptImage) {
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 9bc9c3a

Please sign in to comment.