From 8d7c3f9e3413c4d6ac1a9642ea8a8ed6067acafc Mon Sep 17 00:00:00 2001 From: Pasha8914 Date: Wed, 2 Jun 2021 23:36:38 +1000 Subject: [PATCH] feat: injected request function change version to 0.1.3 --- lib/plugin.js | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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",