Skip to content
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
6 changes: 4 additions & 2 deletions src/components/MoneyRequestConfirmationListFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ function MoneyRequestConfirmationListFooter({

const mentionReportContextValue = useMemo(() => ({currentReportID: reportID, exactlyMatch: true}), [reportID]);

const isRateInteractive = !!rate && !isReadOnly && (!isUnreported || isTrackExpense) && iouType !== CONST.IOU.TYPE.SPLIT;

const getCategoryRightLabelIcon = useCallback(() => (willFieldBeAutomaticallyFilled(transaction, 'category') ? icons.Sparkles : undefined), [transaction, icons.Sparkles]);
const getCategoryRightLabel = useCallback(() => {
if (willFieldBeAutomaticallyFilled(transaction, 'category')) {
Expand Down Expand Up @@ -600,7 +602,7 @@ function MoneyRequestConfirmationListFooter({
item: (
<MenuItemWithTopDescription
key={translate('common.rate')}
shouldShowRightIcon={!!rate && !isReadOnly && !isUnreported && iouType !== CONST.IOU.TYPE.SPLIT}
shouldShowRightIcon={isRateInteractive}
// Pass false for isCustomUnitOutOfPolicy because this is the expense creation/edit
// confirmation screen where a rate violation is not applicable yet.
title={DistanceRequestUtils.getRateForExpenseDisplay(distanceRateName, false, unit, rate, currency, translate, toLocaleDigit, getCurrencySymbol, isOffline)}
Expand Down Expand Up @@ -630,7 +632,7 @@ function MoneyRequestConfirmationListFooter({
}}
brickRoadIndicator={shouldDisplayDistanceRateError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
disabled={didConfirm}
interactive={!!rate && !isReadOnly && iouType !== CONST.IOU.TYPE.SPLIT && !isUnreported}
interactive={isRateInteractive}
sentryLabel={CONST.SENTRY_LABEL.REQUEST_CONFIRMATION_LIST.RATE_FIELD}
/>
),
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function IOURequestStepUpgrade({
// /:action/submit/... when shouldSubmitExpense === true as transaction is not selfDM anymore
const backToRoute = shouldSubmitExpense ? ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(action, CONST.IOU.TYPE.SUBMIT, transactionID, reportID) : undefined;

Navigation.goBack(backToRoute);
Navigation.goBack(backToRoute, {compareParams: false});

setTransactionReport(transactionID, {reportID: expenseReportID}, true);
// Let the confirmation step decide the distance rate because policy data is not fully available at this step
Expand Down
Loading