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

fix: BUG: [distance] request confirmation offline doesn't show TBD #26836

Merged
merged 33 commits into from
Sep 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9d9cc6f
- Implement map route re-fetch on going online
paultsimura Sep 5, 2023
05908dd
Handle null waypoint coordinates correctly
paultsimura Sep 6, 2023
7afdf80
Add hasRouteError check for route re-fetch
paultsimura Sep 6, 2023
0b9596d
Make the shouldFetchRoute condition more readable
paultsimura Sep 6, 2023
af2c13f
Some refactoring
paultsimura Sep 6, 2023
9ce8d13
Translation change
paultsimura Sep 7, 2023
5dc1d8e
Formatting
paultsimura Sep 8, 2023
6d4592f
Fix missing workspace rate
paultsimura Sep 8, 2023
6d35789
Fix missing workspace distance rate
paultsimura Sep 8, 2023
2687882
Merge branch 'main' into fix-26537
paultsimura Sep 11, 2023
7078c52
Merge branch 'main' into fix-26537
paultsimura Sep 11, 2023
6574808
Render map's BlockingView without text
paultsimura Sep 11, 2023
6b0ecd3
Refactoring
paultsimura Sep 11, 2023
034fb4e
Refactoring
paultsimura Sep 11, 2023
7f24db2
Use lodashIsNil
paultsimura Sep 12, 2023
02bfdac
Use lodashIsNil
paultsimura Sep 12, 2023
3a139d4
Merge branch 'main' into fix-26537
paultsimura Sep 12, 2023
b0b2ea2
Add PendingMapView component
paultsimura Sep 12, 2023
59d174c
Polish the distance merchant logic
paultsimura Sep 13, 2023
b0ec8ad
Refactor
paultsimura Sep 13, 2023
29b3b9c
Increase icon dimensions
paultsimura Sep 13, 2023
b89f277
Merge branch 'main' into fix-26537
paultsimura Sep 13, 2023
3ab3c0e
Use icon size variable
paultsimura Sep 13, 2023
40585d5
Merge branch 'main' into fix-26537
paultsimura Sep 15, 2023
c3117fc
Hide "TBD" on the Request button
paultsimura Sep 15, 2023
383f2dd
Fix useMemo deps
paultsimura Sep 15, 2023
d64b0f3
Merge branch 'main' into fix-26537
paultsimura Sep 18, 2023
0644152
Change the request button text logic
paultsimura Sep 18, 2023
9442b59
Merge branch 'main' into fix-26537
paultsimura Sep 18, 2023
3c8d3a9
Remove redundant useNetwork
paultsimura Sep 18, 2023
e0bd72d
Revert "Remove redundant useNetwork"
paultsimura Sep 18, 2023
764bc16
Revert distance rate fix
paultsimura Sep 18, 2023
38014f7
Lint
paultsimura Sep 18, 2023
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
16 changes: 8 additions & 8 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ function MoneyRequestConfirmationList(props) {
const canUseTags = Permissions.canUseTags(props.betas);

const hasRoute = TransactionUtils.hasRoute(transaction);
const formattedAmount =
props.isDistanceRequest && !hasRoute
? translate('common.tbd')
: CurrencyUtils.convertToDisplayString(
shouldCalculateDistanceAmount ? DistanceRequestUtils.getDistanceRequestAmount(distance, unit, rate) : props.iouAmount,
props.isDistanceRequest ? currency : props.iouCurrencyCode,
);
const isDistanceRequestWithoutRoute = props.isDistanceRequest && !hasRoute;
const formattedAmount = isDistanceRequestWithoutRoute
? translate('common.tbd')
: CurrencyUtils.convertToDisplayString(
shouldCalculateDistanceAmount ? DistanceRequestUtils.getDistanceRequestAmount(distance, unit, rate) : props.iouAmount,
props.isDistanceRequest ? currency : props.iouCurrencyCode,
);

useEffect(() => {
if (!shouldCalculateDistanceAmount) {
Expand Down Expand Up @@ -239,7 +239,7 @@ function MoneyRequestConfirmationList(props) {
text = translate('iou.request');
} else {
const translationKey = props.hasMultipleParticipants ? 'iou.splitAmount' : 'iou.requestAmount';
text = translate(translationKey, {amount: formattedAmount});
text = translate(translationKey, {amount: isDistanceRequestWithoutRoute ? '' : formattedAmount});
Copy link
Contributor

Choose a reason for hiding this comment

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

@paultsimura Is there any point at which we have a distance request utilizing iou.splitAmount, or could we just modify above to something like if (props.receiptPath || isDistanceRequestWithoutRoute) { ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, at the moment the Distance request doesn't allow splitting the bill. Updated, ready for the final review.

}
return [
{
Expand Down