diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 7d837d6f0ae6..680d1c7ed9f4 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -6,7 +6,7 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Policy, PolicyTagLists, Report, ReportAction} from '@src/types/onyx'; -import {getDecodedCategoryName} from './CategoryUtils'; +import {getDecodedCategoryName, isCategoryMissing} from './CategoryUtils'; import {convertToDisplayString} from './CurrencyUtils'; import DateUtils from './DateUtils'; import {getEnvironmentURL} from './Environment/Environment'; @@ -62,7 +62,18 @@ function buildMessageFragmentForValue( shouldConvertToLowercase = true, ) { const newValueToDisplay = valueInQuotes ? `"${newValue}"` : newValue; - const oldValueToDisplay = valueInQuotes ? `"${oldValue}"` : oldValue; + + // If the valueName is category and the old value was Uncategorized, show it in lowercase without quotes + let oldValueToDisplay; + // eslint-disable-next-line @typescript-eslint/no-deprecated + if (valueName.includes(translateLocal('common.category').toLowerCase()) && isCategoryMissing(oldValue)) { + oldValueToDisplay = oldValue.toLowerCase(); + } else if (valueInQuotes) { + oldValueToDisplay = `"${oldValue}"`; + } else { + oldValueToDisplay = oldValue; + } + const displayValueName = shouldConvertToLowercase ? valueName.toLowerCase() : valueName; // eslint-disable-next-line @typescript-eslint/no-deprecated const isOldValuePartialMerchant = valueName === translateLocal('common.merchant') && oldValue === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;