Skip to content

Commit

Permalink
reused tagForDisplay variable
Browse files Browse the repository at this point in the history
  • Loading branch information
FitseTLT committed Aug 15, 2024
1 parent 88a7418 commit c4adb96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ function MoneyRequestView({
};

const tagList = policyTagLists.map(({name, orderWeight, tags}, index) => {
const tag = TransactionUtils.getTagForDisplay(updatedTransaction ?? transaction, index);
const shouldShow = !!tag || OptionsListUtils.hasEnabledOptions(tags);
const tagForDisplay = TransactionUtils.getTagForDisplay(updatedTransaction ?? transaction, index);
const shouldShow = !!tagForDisplay || OptionsListUtils.hasEnabledOptions(tags);
if (!shouldShow) {
return null;
}
Expand All @@ -426,7 +426,7 @@ function MoneyRequestView({
tagListName: name,
},
PolicyUtils.hasDependentTags(policy, policyTagList),
TransactionUtils.getTagForDisplay(updatedTransaction ?? transaction, index),
tagForDisplay,
);
return (
<OfflineWithFeedback
Expand All @@ -435,7 +435,7 @@ function MoneyRequestView({
>
<MenuItemWithTopDescription
description={name ?? translate('common.tag')}
title={tag}
title={tagForDisplay}
interactive={canEdit && !readonly}
shouldShowRightIcon={canEdit && !readonly}
titleStyle={styles.flex1}
Expand Down

0 comments on commit c4adb96

Please sign in to comment.