From e6d7af9d74638fe6c2e043bdbf1ed4424c7908be Mon Sep 17 00:00:00 2001 From: truemiller Date: Wed, 28 Aug 2024 16:42:01 +0100 Subject: [PATCH] refactor: remove reassignment --- .../MainPage/sections/AddFundsSection.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/frontend/components/MainPage/sections/AddFundsSection.tsx b/frontend/components/MainPage/sections/AddFundsSection.tsx index d61970e7f..ad3e17053 100644 --- a/frontend/components/MainPage/sections/AddFundsSection.tsx +++ b/frontend/components/MainPage/sections/AddFundsSection.tsx @@ -18,7 +18,6 @@ import styled from 'styled-components'; import { UNICODE_SYMBOLS } from '@/constants/symbols'; import { COW_SWAP_GNOSIS_XDAI_OLAS_URL } from '@/constants/urls'; import { useWallet } from '@/hooks/useWallet'; -import { Address } from '@/types/Address'; import { copyToClipboard } from '@/utils/copyToClipboard'; import { truncateAddress } from '@/utils/truncate'; @@ -66,27 +65,25 @@ export const AddFundsSection = () => { export const OpenAddFundsSection = () => { const { masterSafeAddress } = useWallet(); - const fundingAddress: Address | undefined = masterSafeAddress; - const truncatedFundingAddress: string | undefined = useMemo( - () => fundingAddress && truncateAddress(fundingAddress), - [fundingAddress], + () => masterSafeAddress && truncateAddress(masterSafeAddress), + [masterSafeAddress], ); const handleCopyAddress = useCallback( () => - fundingAddress && - copyToClipboard(fundingAddress).then(() => + masterSafeAddress && + copyToClipboard(masterSafeAddress).then(() => message.success('Copied successfully!'), ), - [fundingAddress], + [masterSafeAddress], ); return ( <>