diff --git a/src/libs/fileDownload/getPhotoSource/index.android.ts b/src/libs/fileDownload/getPhotoSource/index.android.ts new file mode 100644 index 000000000000..2d44d7fbf2db --- /dev/null +++ b/src/libs/fileDownload/getPhotoSource/index.android.ts @@ -0,0 +1,5 @@ +function getPhotoSource(filePath: string): string { + return `file://${filePath}`; +} + +export default getPhotoSource; diff --git a/src/libs/fileDownload/getPhotoSource/index.ts b/src/libs/fileDownload/getPhotoSource/index.ts new file mode 100644 index 000000000000..efbdeb54a063 --- /dev/null +++ b/src/libs/fileDownload/getPhotoSource/index.ts @@ -0,0 +1,5 @@ +function getPhotoSource(filePath: string): string { + return filePath; +} + +export default getPhotoSource; diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx index 9c24e92689cc..536b8eefecb4 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx @@ -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'; @@ -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) => {