diff --git a/src/sections/finance/components/finance-display-profile-info.tsx b/src/sections/finance/components/finance-display-profile-info.tsx index 2f802c68..cc0bf658 100644 --- a/src/sections/finance/components/finance-display-profile-info.tsx +++ b/src/sections/finance/components/finance-display-profile-info.tsx @@ -38,7 +38,7 @@ const FinanceDisplayProfileInfo: FC = ({initialList, ca { mode === 'profile' ? ( - {selectedProfile?.metadata?.displayName ?? 'No profile selected'} + {selectedProfile?.metadata?.displayName ?? selectedProfile?.handle?.localName ?? 'No profile selected'} ) : null } { diff --git a/src/sections/finance/components/finance-quick-transfer-modal.tsx b/src/sections/finance/components/finance-quick-transfer-modal.tsx index 9b6ea31b..2b6812e0 100644 --- a/src/sections/finance/components/finance-quick-transfer-modal.tsx +++ b/src/sections/finance/components/finance-quick-transfer-modal.tsx @@ -154,7 +154,7 @@ function FinanceQuickTransferModal({ notifySuccess(SUCCESS.TRANSFER_CREATED_SUCCESSFULLY, { destination: isSame - ? contactInfo?.metadata?.displayName + ? contactInfo?.metadata?.displayName ?? contactInfo?.handle?.localName : truncateAddress(address ?? ''), }); } catch (err: any) { diff --git a/src/sections/finance/components/finance-quick-transfer.tsx b/src/sections/finance/components/finance-quick-transfer.tsx index 0ed63538..60d7753f 100644 --- a/src/sections/finance/components/finance-quick-transfer.tsx +++ b/src/sections/finance/components/finance-quick-transfer.tsx @@ -103,6 +103,7 @@ export default function FinanceQuickTransfer({ // 3) Move the carousel right now carousel.setCurrentIndex(finalIndex); + setCurrentIndex(finalIndex); // 4) Update the wallet address & Redux setWalletAddress(profile.ownedBy?.address ?? ''); @@ -254,9 +255,6 @@ export default function FinanceQuickTransfer({ } }, [showRainbow, currentIndex, carousel]); - // We pick the contactInfo to pass to the modal. If currentIndex is -1, there's no matched profile - const contactInfoToPass = currentIndex === -1 ? undefined : getContactInfo; - // Render the carousel of profiles const renderCarousel = ( @@ -374,7 +372,6 @@ export default function FinanceQuickTransfer({ const Wrapper = showRainbow ? NeonPaper : Box; - console.log(list); return ( <> - + {list?.length > 0 ? renderCarousel : } - + {renderInput} @@ -417,7 +414,7 @@ export default function FinanceQuickTransfer({ address={walletAddress} onClose={confirm.onFalse} onFinish={handleTransferFinish} - contactInfo={contactInfoToPass} // If currentIndex is -1, this is undefined + contactInfo={getContactInfo} onChange={handleChangeInput} /> diff --git a/src/utils/wallet.ts b/src/utils/wallet.ts index 6f6455fd..933dedbb 100644 --- a/src/utils/wallet.ts +++ b/src/utils/wallet.ts @@ -2,6 +2,8 @@ // ---------------------------------------------------------------------- export const truncateAddress = (text: string, startChars: number = 6, endChars: number = 6) => { + if (!text) return ''; + if (text.length <= startChars + endChars) { return text; }