Skip to content

Commit

Permalink
Merge pull request #53538 from dukenv0307/fix/remove-cardList-when-sh…
Browse files Browse the repository at this point in the history
…owing-assign-card-button

fix: remove cardList when showing assign card button
  • Loading branch information
mountiny authored Dec 5, 2024
2 parents b384924 + 7f3ecc0 commit c686295
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) {
const [cardFeeds] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${workspaceAccountID}`);
const selectedFeed = CardUtils.getSelectedFeed(lastSelectedFeed, cardFeeds);
const [cardsList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID}_${selectedFeed}`);

const {cardList, ...cards} = cardsList ?? {};
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);

const filteredCardList = CardUtils.getFilteredCardList(cardsList, selectedFeed ? cardFeeds?.settings?.oAuthAccountDetails?.[selectedFeed] : undefined);
Expand Down Expand Up @@ -123,7 +125,7 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) {
<WorkspaceCompanyCardsListHeaderButtons
policyID={policyID}
selectedFeed={selectedFeed}
shouldShowAssignCardButton={isPending || !isEmptyObject(cardsList)}
shouldShowAssignCardButton={isPending || !isEmptyObject(cards)}
handleAssignCard={handleAssignCard}
/>
)}
Expand Down

0 comments on commit c686295

Please sign in to comment.