diff --git a/connectors/injected.ts b/connectors/injected.ts index c93a31b..d60596d 100644 --- a/connectors/injected.ts +++ b/connectors/injected.ts @@ -19,8 +19,8 @@ export default class Connector extends LockConnector { async isLoggedIn() { if (!window['ethereum']) return false; - if (window['ethereum'].selectedAddress) return true; + if (window['ethereum'].request({method: 'eth_accounts'})) return true; await new Promise((r) => setTimeout(r, 400)); - return !!window['ethereum'].selectedAddress; + return !!window['ethereum'].request({method: 'eth_accounts'}); } } diff --git a/package.json b/package.json index 1fc84dd..ea6a06e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@snapshot-labs/lock", - "version": "0.2.2", + "version": "0.2.3", "repository": "snapshot-labs/lock", "license": "MIT", "main": "dist/lock.cjs.js",