Skip to content

Commit

Permalink
Merge pull request #48194 from ishpaul777/fix/48118
Browse files Browse the repository at this point in the history
[CP staging][FIX] iOS - Scan - After taking picture, image is not displayed on confirmation screen
  • Loading branch information
neil-marcellini authored Aug 28, 2024
2 parents 0c79dc1 + c68e8f8 commit 392da13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/libs/fileDownload/getPhotoSource/index.android.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function getPhotoSource(filePath: string): string {
return `file://${filePath}`;
}

export default getPhotoSource;
5 changes: 5 additions & 0 deletions src/libs/fileDownload/getPhotoSource/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function getPhotoSource(filePath: string): string {
return filePath;
}

export default getPhotoSource;
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import * as FileUtils from '@libs/fileDownload/FileUtils';
import getPhotoSource from '@libs/fileDownload/getPhotoSource';
import getCurrentPosition from '@libs/getCurrentPosition';
import Log from '@libs/Log';
import Navigation from '@libs/Navigation/Navigation';
Expand Down Expand Up @@ -446,7 +447,7 @@ function IOURequestStepScan({
})
.then((photo: PhotoFile) => {
// Store the receipt on the transaction object in Onyx
const source = `file://${photo.path}`;
const source = getPhotoSource(photo.path);
IOU.setMoneyRequestReceipt(transactionID, source, photo.path, action !== CONST.IOU.ACTION.EDIT);

FileUtils.readFileAsync(source, photo.path, (file) => {
Expand Down

0 comments on commit 392da13

Please sign in to comment.