From 47d9fa81b026759f4213ed3c638a964ea60960de Mon Sep 17 00:00:00 2001 From: bloodyowl Date: Thu, 12 Oct 2023 11:19:25 +0200 Subject: [PATCH] Fix conditions --- .../banking/src/components/CardItemArea.tsx | 9 +++------ .../components/CardItemPhysicalDetails.tsx | 20 ++++++++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/clients/banking/src/components/CardItemArea.tsx b/clients/banking/src/components/CardItemArea.tsx index b9785a1e3..e4c846ce4 100644 --- a/clients/banking/src/components/CardItemArea.tsx +++ b/clients/banking/src/components/CardItemArea.tsx @@ -173,14 +173,11 @@ export const CardItemArea = ({ label: t("cardDetail.transactions"), url: Router.AccountCardsItemTransactions({ accountMembershipId, cardId }), }, - ...match({ canManageAccountMembership, card }) + ...match(card) .with( { - canManageAccountMembership: true, - card: { - statusInfo: { - __typename: P.not(P.union("CardCanceledStatusInfo", "CardCancelingStatusInfo")), - }, + statusInfo: { + __typename: P.not(P.union("CardCanceledStatusInfo", "CardCancelingStatusInfo")), }, }, () => [ diff --git a/clients/banking/src/components/CardItemPhysicalDetails.tsx b/clients/banking/src/components/CardItemPhysicalDetails.tsx index 18d7e8028..78b0c0be8 100644 --- a/clients/banking/src/components/CardItemPhysicalDetails.tsx +++ b/clients/banking/src/components/CardItemPhysicalDetails.tsx @@ -984,17 +984,23 @@ export const CardItemPhysicalDetails = ({ ], ) .otherwise(() => []), - ...match(physicalCard.statusInfo) + ...match({ statusInfo: physicalCard.statusInfo, isCurrentUserCardOwner }) .with( { - __typename: P.union( - "PhysicalCardRenewedStatusInfo", - "PhysicalCardToActivateStatusInfo", - ), - isPINReady: true, + isCurrentUserCardOwner: true, + statusInfo: { + __typename: P.union( + "PhysicalCardRenewedStatusInfo", + "PhysicalCardToActivateStatusInfo", + ), + isPINReady: true, + }, }, { - __typename: "PhysicalCardActivatedStatusInfo", + isCurrentUserCardOwner: true, + statusInfo: { + __typename: "PhysicalCardActivatedStatusInfo", + }, }, () => [ {