From ffbf204b3243e31c4119f35719ea3dab51332c88 Mon Sep 17 00:00:00 2001 From: KillariDev Date: Mon, 10 Jun 2024 13:13:19 +0300 Subject: [PATCH] prevent race condition with signer connections. No need to wait for signer accounts if we already have them, or already are waiting for them --- app/inpage/ts/inpage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/inpage/ts/inpage.ts b/app/inpage/ts/inpage.ts index 09c7385f..4cb70ed7 100644 --- a/app/inpage/ts/inpage.ts +++ b/app/inpage/ts/inpage.ts @@ -624,7 +624,7 @@ class InterceptorMessageListener { } if (signerName !== 'NoSigner') { - this.waitForAccountsFromWallet = new InterceptorFuture() + if (this.waitForAccountsFromWallet === undefined && this.signerAccounts.length === 0) this.waitForAccountsFromWallet = new InterceptorFuture() this.enableMetamaskCompatibilityMode((await connectToSigner()).metamaskCompatibilityMode) await this.requestChainIdFromSigner() await this.getAccountsFromSigner()