From e038dd98a4edd652dabb5bf54650b33af1e70478 Mon Sep 17 00:00:00 2001 From: Sven Date: Wed, 3 Jan 2024 14:50:30 +0100 Subject: [PATCH] add isUnlocked check --- packages/wagmi/src/connectors/EIP6963Connector.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/wagmi/src/connectors/EIP6963Connector.ts b/packages/wagmi/src/connectors/EIP6963Connector.ts index 8cae8f406c..7e34d35844 100644 --- a/packages/wagmi/src/connectors/EIP6963Connector.ts +++ b/packages/wagmi/src/connectors/EIP6963Connector.ts @@ -74,10 +74,18 @@ export class EIP6963Connector extends InjectedConnector { if (!eip6963Wallet || connectedEIP6963Rdns !== eip6963Wallet.info.rdns) { return true } + } + + if ( + (eip6963Wallet && eip6963Wallet.provider._state?.isUnlocked === undefined) || + (eip6963Wallet && eip6963Wallet.provider._state?.isUnlocked) + ) { this.#eip6963Wallet = eip6963Wallet + + return super.isAuthorized() } - return super.isAuthorized() + return false } public override async getProvider() {