Skip to content

Commit

Permalink
Minor code updates
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Nov 14, 2024
1 parent 7dc1a0b commit 4aa6297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/libs/CardUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ function removeExpensifyCardFromCompanyCards(cardFeeds: OnyxEntry<CardFeeds>): C
}

const companyCards = getCompanyFeeds(cardFeeds);

return Object.fromEntries(Object.entries(companyCards).filter(([key]) => key !== CONST.EXPENSIFY_CARD.BANK));
}

Expand Down Expand Up @@ -300,7 +299,6 @@ function getCustomOrFormattedFeedName(feed?: CompanyCardFeed, companyCardNicknam

const customFeedName = companyCardNicknames?.[feed];
const formattedFeedName = Localize.translateLocal('workspace.companyCards.feedName', {feedName: getCardFeedName(feed)});

return customFeedName ?? formattedFeedName;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) {

const companyCards = CardUtils.removeExpensifyCardFromCompanyCards(cardFeeds);
const isLoading = !cardFeeds || !!(cardFeeds.isLoading && !companyCards);
const selectedCompanyCard = selectedFeed && companyCards[selectedFeed];
const isNoFeed = isEmptyObject(companyCards) && !selectedCompanyCard;
const isPending = !!selectedCompanyCard?.pending;
const selectedFeedData = selectedFeed && companyCards[selectedFeed];
const isNoFeed = isEmptyObject(companyCards) && !selectedFeedData;
const isPending = !!selectedFeedData?.pending;
const isFeedAdded = !isPending && !isNoFeed;

const fetchCompanyCards = useCallback(() => {
Expand Down

0 comments on commit 4aa6297

Please sign in to comment.