Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP staging][FIX] iOS - Scan - After taking picture, image is not displayed on confirmation screen #48194

Merged
merged 4 commits into from
Aug 28, 2024
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);
Copy link
Contributor Author

@ishpaul777 ishpaul777 Aug 28, 2024

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
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
Loading