From 8ad16d219ad0263b44574ffb6e22c9518928b988 Mon Sep 17 00:00:00 2001 From: katspaugh Date: Tue, 14 Nov 2023 13:08:03 +0100 Subject: [PATCH] Fix accounts[0] and Delete Account --- src/components/common/WalletInfo/index.test.tsx | 4 ++-- src/hooks/wallets/useOnboard.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/common/WalletInfo/index.test.tsx b/src/components/common/WalletInfo/index.test.tsx index e402e7dd4a..44a9e7a7f8 100644 --- a/src/components/common/WalletInfo/index.test.tsx +++ b/src/components/common/WalletInfo/index.test.tsx @@ -122,7 +122,7 @@ describe('WalletInfo', () => { />, ) - expect(queryByText('Delete Account')).not.toBeInTheDocument() + expect(queryByText('Delete account')).not.toBeInTheDocument() }) it('should not display a Delete Account if not social login', () => { @@ -140,7 +140,7 @@ describe('WalletInfo', () => { />, ) - expect(queryByText('Delete Account')).not.toBeInTheDocument() + expect(queryByText('Delete account')).not.toBeInTheDocument() }) it('should display an enable mfa button if mfa is not enabled', () => { diff --git a/src/hooks/wallets/useOnboard.ts b/src/hooks/wallets/useOnboard.ts index 6d98c20ae0..ef20d4f128 100644 --- a/src/hooks/wallets/useOnboard.ts +++ b/src/hooks/wallets/useOnboard.ts @@ -42,7 +42,7 @@ export const getConnectedWallet = (wallets: WalletState[]): ConnectedWallet | nu const primaryWallet = wallets[0] if (!primaryWallet) return null - const account = primaryWallet.accounts[primaryWallet.accounts.length - 1] + const account = primaryWallet.accounts[0] if (!account) return null try {