Skip to content

Commit

Permalink
Fix conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodyowl committed Oct 12, 2023
1 parent 137f5c9 commit 47d9fa8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
9 changes: 3 additions & 6 deletions clients/banking/src/components/CardItemArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
},
},
() => [
Expand Down
20 changes: 13 additions & 7 deletions clients/banking/src/components/CardItemPhysicalDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
() => [
{
Expand Down

0 comments on commit 47d9fa8

Please sign in to comment.