Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import * as CurrencyUtils from '@libs/CurrencyUtils';
import DateUtils from '@libs/DateUtils';
import Parser from '@libs/Parser';
import StringUtils from '@libs/StringUtils';
import * as TransactionUtils from '@libs/TransactionUtils';
import tryResolveUrlFromApiRoot from '@libs/tryResolveUrlFromApiRoot';
Expand Down Expand Up @@ -126,9 +127,9 @@ function MerchantCell({transactionItem, showTooltip, isLargeScreenWidth}: Transa
const description = TransactionUtils.getDescription(transactionItem);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not parse here only ??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's better to parse it only when we need to show the description. WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

okay thats a good point 👍

let merchantOrDescriptionToDisplay = transactionItem.formattedMerchant;
if (!merchantOrDescriptionToDisplay && !isLargeScreenWidth) {
merchantOrDescriptionToDisplay = description;
merchantOrDescriptionToDisplay = Parser.htmlToText(Parser.replace(description));
}
let merchant = transactionItem.shouldShowMerchant ? merchantOrDescriptionToDisplay : description;
let merchant = transactionItem.shouldShowMerchant ? merchantOrDescriptionToDisplay : Parser.htmlToText(Parser.replace(description));

if (TransactionUtils.hasReceipt(transactionItem) && TransactionUtils.isReceiptBeingScanned(transactionItem) && transactionItem.shouldShowMerchant) {
merchant = translate('iou.receiptStatusTitle');
Expand Down