Skip to content

Commit

Permalink
SubmitDetailsPage with onSuccess comments, yet to change
Browse files Browse the repository at this point in the history
  • Loading branch information
Guccio163 committed Dec 16, 2024
1 parent 2276bb6 commit f8a33c2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pages/Share/SubmitDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ function SubmitDetailsPage({

const receipt: Receipt = file;
receipt.state = file && CONST.IOU.RECEIPT_STATE.SCANREADY;
if (transaction?.amount === undefined || transaction?.amount === 0) {
// I guess we don't need to check the amount, it is checked in IOURequestStepConfirmation to deduce whether it is a scan or normal request, so here we only need locationPermissionGranted, btw we should still finishRequestAndNavigate even if locationPermissionGranted is false, just without coordinates, just like with error

This comment has been minimized.

Copy link
@filip-solecki

filip-solecki Dec 17, 2024

Contributor

you're right about the amount, in the second case I think it is being handled by errorFunction (second argument of getCurrentPosition), I just checked it and worked fine without adding lines 128 and 129

if (locationPermissionGranted) {
getCurrentPosition(
(successData) => {
Report.openReport(report.reportID, '', [unknownUserDetails?.login ?? ''], optimisticReport, undefined, undefined, undefined, undefined);

// I guess we don't need it, IOURequestStepConfirmation doesn't
// Report.openReport(report.reportID, '', [unknownUserDetails?.login ?? ''], optimisticReport, undefined, undefined, undefined, undefined);
finishRequestAndNavigate(participant, receipt, {
lat: successData.coords.latitude,
long: successData.coords.longitude,
Expand All @@ -124,6 +125,8 @@ function SubmitDetailsPage({
},
);
}
// If the GPS localization is prohibited the money can still be requested, it just won't include the GPS coordinates
finishRequestAndNavigate(participant, receipt);
};

const onConfirm = (gpsRequired?: boolean) => {
Expand Down

0 comments on commit f8a33c2

Please sign in to comment.