From d9469060f57505ce9af8849296fd716d1c4c734d Mon Sep 17 00:00:00 2001 From: Michele Esposito Date: Tue, 2 May 2023 11:39:28 +0200 Subject: [PATCH] feat: addNewAccount doesn't select new account --- packages/keyring-controller/src/KeyringController.test.ts | 1 + packages/keyring-controller/src/KeyringController.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/keyring-controller/src/KeyringController.test.ts b/packages/keyring-controller/src/KeyringController.test.ts index b79fec41d1..b9da878dfb 100644 --- a/packages/keyring-controller/src/KeyringController.test.ts +++ b/packages/keyring-controller/src/KeyringController.test.ts @@ -110,6 +110,7 @@ describe('KeyringController', () => { currentKeyringMemState.keyrings[0].accounts, ), ).toBe(true); + expect(preferences.setSelectedAddress.called).toBe(false); }); }); diff --git a/packages/keyring-controller/src/KeyringController.ts b/packages/keyring-controller/src/KeyringController.ts index 0ef55b7eae..ceb07aed0f 100644 --- a/packages/keyring-controller/src/KeyringController.ts +++ b/packages/keyring-controller/src/KeyringController.ts @@ -226,7 +226,6 @@ export class KeyringController extends BaseController< const addedAccountAddress = newAccounts.find( (selectedAddress: string) => !oldAccounts.includes(selectedAddress), ); - this.setSelectedAddress(addedAccountAddress); return { keyringState: await this.fullUpdate(), addedAccountAddress,