diff --git a/lib/plugin.js b/lib/plugin.js index ebdcacd..3807c41 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -197,9 +197,13 @@ export default (ctx, inject) => { async _initProvider() { try { - const request = () => + let request = () => this.version === 'old' ? this.provider.enable() : this.sendRequest({ method: 'eth_requestAccounts' }) + if (this.provider.injectedRequest && typeof this.provider.injectedRequest === 'function') { + request = () => this.provider.injectedRequest() + } + const [account] = await request() if (!account) { diff --git a/package.json b/package.json index 87e19b2..b3d67e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuxt-web3-provider", - "version": "0.1.2", + "version": "0.1.3", "description": "Provider integration with Nuxt.js", "repository": { "type": "git",