Skip to content

Commit

Permalink
Merge pull request #57448 from huult/56674-delete-distance-rate-error
Browse files Browse the repository at this point in the history
resolve error shown below default rate when deleting selected rate
  • Loading branch information
arosiclair authored Feb 27, 2025
2 parents a75fbdb + 434ed3e commit 10328de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals
amountTitle = translate('iou.receiptStatusTitle');
}

const isCustomUnitOutOfPolicy = transactionViolations.some((violation) => violation.name === CONST.VIOLATIONS.CUSTOM_UNIT_OUT_OF_POLICY);

const updatedTransactionDescription = useMemo(() => {
if (!updatedTransaction) {
return undefined;
Expand Down Expand Up @@ -376,7 +378,7 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals
<OfflineWithFeedback pendingAction={getPendingFieldAction('customUnitRateID')}>
<MenuItemWithTopDescription
description={translate('common.rate')}
title={rateToDisplay}
title={isCustomUnitOutOfPolicy ? translate('common.rateOutOfPolicy') : rateToDisplay}
interactive={canEditDistanceRate}
shouldShowRightIcon={canEditDistanceRate}
titleStyle={styles.flex1}
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ const translations = {
perDiem: 'Per diem',
validate: 'Validate',
expenseReports: 'Expense Reports',
rateOutOfPolicy: 'Rate out of policy',
},
supportalNoAccess: {
title: 'Not so fast',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ const translations = {
perDiem: 'Per diem',
validate: 'Validar',
expenseReports: 'Informes de Gastos',
rateOutOfPolicy: 'Tasa fuera de póliza',
},
supportalNoAccess: {
title: 'No tan rápido',
Expand Down

0 comments on commit 10328de

Please sign in to comment.