Skip to content

Commit

Permalink
fix file select
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Sep 18, 2023
1 parent 1a8f8f5 commit 72eca6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/iou/ReceiptSelector/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import * as CameraPermission from './CameraPermission';
import {iouPropTypes, iouDefaultProps} from '../propTypes';
import NavigationAwareCamera from './NavigationAwareCamera';
import Navigation from '../../../libs/Navigation/Navigation';
import * as FileUtils from '../../../libs/fileDownload/FileUtils';

const propTypes = {
/** React Navigation route */
Expand Down Expand Up @@ -272,10 +273,13 @@ function ReceiptSelector({route, report, iou, transactionID}) {
onPress={() => {
showImagePicker(launchImageLibrary)
.then((receiptImage) => {
IOU.setMoneyRequestReceipt(receiptImage[0].uri, receiptImage[0].fileName);
const filePath = receiptImage[0].uri;
IOU.setMoneyRequestReceipt(filePath, receiptImage[0].fileName);

if (transactionID) {
IOU.replaceReceipt(transactionID, receiptImage, receiptImage[0].uri);
FileUtils.readFileAsync(filePath, receiptImage[0].fileName).then((receipt) => {
IOU.replaceReceipt(transactionID, receipt, filePath);
});
Navigation.dismissModal();
return;
}
Expand Down

0 comments on commit 72eca6d

Please sign in to comment.