From fcc61ee7fb1e8a1748b0d89cd9950a61295a18fb Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Mon, 16 Dec 2024 19:03:58 +0500 Subject: [PATCH] fix: compare recipient address with no case sensitivity (#5208) --- .../modules/account/containers/Transaction/ActivityDetails.tsx | 3 ++- .../src/utils/orderUtils/getIsCustomRecipient.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/cowswap-frontend/src/modules/account/containers/Transaction/ActivityDetails.tsx b/apps/cowswap-frontend/src/modules/account/containers/Transaction/ActivityDetails.tsx index ba5a2e8a76..6e41f34912 100644 --- a/apps/cowswap-frontend/src/modules/account/containers/Transaction/ActivityDetails.tsx +++ b/apps/cowswap-frontend/src/modules/account/containers/Transaction/ActivityDetails.tsx @@ -35,6 +35,7 @@ import { useHideReceiverWalletBanner, useIsReceiverWalletBannerHidden, } from 'common/state/receiverWalletBannerVisibility' +import { getIsCustomRecipient } from 'utils/orderUtils/getIsCustomRecipient' import { getUiOrderType } from 'utils/orderUtils/getUiOrderType' import { StatusDetails } from './StatusDetails' @@ -298,7 +299,7 @@ export function ActivityDetails(props: { outputToken = COW[chainId as SupportedChainId] } - const isCustomRecipient = Boolean(order?.receiver && order.owner !== order.receiver) + const isCustomRecipient = !!order && getIsCustomRecipient(order) return ( <> diff --git a/apps/cowswap-frontend/src/utils/orderUtils/getIsCustomRecipient.ts b/apps/cowswap-frontend/src/utils/orderUtils/getIsCustomRecipient.ts index 1260aad6b2..149b083ccb 100644 --- a/apps/cowswap-frontend/src/utils/orderUtils/getIsCustomRecipient.ts +++ b/apps/cowswap-frontend/src/utils/orderUtils/getIsCustomRecipient.ts @@ -1,5 +1,5 @@ import { Order } from 'legacy/state/orders/actions' export function getIsCustomRecipient({ owner, receiver }: Pick): boolean { - return Boolean(receiver && owner !== receiver) + return Boolean(receiver && owner.toLowerCase() !== receiver.toLowerCase()) }