Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ function SpendRulePageBase({policyID, ruleID, titleKey, testID}: SpendRulePageBa
};

function getCardsMenuTitle(cardIDsToSummarize: string[] | undefined): string {
const activeCardIDs = cardIDsToSummarize?.filter((id) => cardsList?.[id] !== undefined);
return getTruncatedSpendRuleSummary(
cardIDsToSummarize?.map((id) => {
activeCardIDs?.map((id) => {
const card = cardsList?.[id];
if (card === undefined) {
return id;
Expand Down
11 changes: 9 additions & 2 deletions src/pages/workspace/rules/SpendRules/SpendRulesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,16 @@ function SpendRulesSection({policyID}: SpendRulesSectionProps) {
return undefined;
}
const actionLabel = formValues.restrictionAction === CONST.SPEND_RULES.ACTION.BLOCK ? blockLabel : allowLabel;
const selectedCurrency = getSelectedCardsSharedCurrency(formValues.cardIDs, cardsList);
const activeCardIDs = formValues.cardIDs.filter((cardID) => {
const card = cardsList?.[cardID];
return card && isCard(card);
});
if (activeCardIDs.length === 0) {
return undefined;
}
const selectedCurrency = getSelectedCardsSharedCurrency(activeCardIDs, cardsList);
const cardSummary = getTruncatedSpendRuleSummary(
formValues.cardIDs.map((cardID) => {
activeCardIDs.map((cardID) => {
const card = cardsList?.[cardID];
if (!card || !isCard(card)) {
return cardID;
Expand Down
Loading