Skip to content

Commit

Permalink
Fix Request - User is redirected to participant selection page after …
Browse files Browse the repository at this point in the history
…adding a receipt
  • Loading branch information
tgolen committed Nov 28, 2023
1 parent 24e39fa commit f53fa56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/pages/iou/request/step/IOURequestStepScan/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ function IOURequestStepScan({
const fileSource = URL.createObjectURL(file);
IOU.setMoneyRequestReceipt_temporaryForRefactor(transactionID, fileSource, file.name);

if (backTo) {
Navigation.goBack(backTo);
return;
}

// When an existing transaction is being edited (eg. not the create transaction flow)
if (transactionID !== CONST.IOU.OPTIMISTIC_TRANSACTION_ID) {
IOU.replaceReceipt(transactionID, file, fileSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const defaultProps = {
function IOURequestStepScan({
report,
route: {
params: {iouType, reportID, transactionID, pageIndex},
params: {iouType, reportID, transactionID, pageIndex, backTo},
},
}) {
const theme = useTheme();
Expand Down Expand Up @@ -132,6 +132,11 @@ function IOURequestStepScan({
const filePath = `file://${photo.path}`;
IOU.setMoneyRequestReceipt_temporaryForRefactor(transactionID, filePath, photo.path);

if (backTo) {
Navigation.goBack(backTo);
return;
}

const onSuccess = (receipt) => {
IOU.replaceReceipt(transactionID, receipt, filePath);
};
Expand Down

0 comments on commit f53fa56

Please sign in to comment.