From 4aa629755bb3db12147ca08c11f1538b043f2b2d Mon Sep 17 00:00:00 2001 From: VickyStash Date: Thu, 14 Nov 2024 09:14:58 +0100 Subject: [PATCH] Minor code updates --- src/libs/CardUtils.ts | 2 -- .../workspace/companyCards/WorkspaceCompanyCardsPage.tsx | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index ea3e82dd458e..e2bb14f21a30 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -256,7 +256,6 @@ function removeExpensifyCardFromCompanyCards(cardFeeds: OnyxEntry): C } const companyCards = getCompanyFeeds(cardFeeds); - return Object.fromEntries(Object.entries(companyCards).filter(([key]) => key !== CONST.EXPENSIFY_CARD.BANK)); } @@ -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; } diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx index 2a3055475dbe..9378da7c6599 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx @@ -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(() => {