Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);

@ishpaul777 ishpaul777 Aug 28, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to strip file:// from photo.path here? @neil-marcellini on IOS

IOU.setMoneyRequestReceipt(transactionID, source, photo.path, action !== CONST.IOU.ACTION.EDIT);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I think it's fine yes? Now we're only adding file:// on Android so no reason to strip double occurrence of it.


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