From a9cc7ec43e62b0e18f5a343eec6f8a0bc839f753 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 4 Aug 2022 13:03:39 +0700 Subject: [PATCH] Fix walletconnect --- connectors/walletconnect.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/connectors/walletconnect.ts b/connectors/walletconnect.ts index 290ee72..210ff40 100644 --- a/connectors/walletconnect.ts +++ b/connectors/walletconnect.ts @@ -1,23 +1,23 @@ -const get = () => import(/* webpackChunkName: "walletconnect" */ '@walletconnect/web3-provider'); import LockConnector from '../src/connector'; export default class Connector extends LockConnector { async connect() { - let provider; + let provider; try { - let WalletConnectProvider = (await get()).default; - if (WalletConnectProvider.default) - WalletConnectProvider = WalletConnectProvider.default; - provider = new WalletConnectProvider(this.options); + const WalletConnectProvider = await import( + "@walletconnect/web3-provider/dist/umd/index.min.js"! + ); + provider = new WalletConnectProvider.default(this.options); await provider.enable(); } catch (e) { console.error(e); return; } - provider.connectorName = 'walletconnect'; + provider.connectorName = "walletconnect"; return provider; } + logout() { if (localStorage) { localStorage.removeItem('walletconnect');