Skip to content

Commit

Permalink
Merge pull request #63 from XDeFi-tech/feat/walletconnect-v2
Browse files Browse the repository at this point in the history
fix: avoid walletconnect reinitialization
  • Loading branch information
Amurmurmur committed Jul 26, 2023
2 parents f1b2885 + b261c43 commit e774838
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xdefi/wallets-connector",
"version": "1.6.3",
"version": "1.6.4",
"description": "Cross chain wallets connector with react hooks",
"author": "garageinc",
"license": "MIT",
Expand Down
6 changes: 5 additions & 1 deletion src/providers/connectors/walletconnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ export interface IWalletConnectConnectorOptions {
showQrModal: boolean
}

let provider: any = false

const ConnectToWalletConnect = async (
WalletConnectProvider: any,
opts: IWalletConnectConnectorOptions
) => {
const provider = await WalletConnectProvider.init(opts)
if (!provider) {
provider = await WalletConnectProvider.init(opts)
}

provider.removeAllListeners = provider.events.removeAllListeners.bind(
provider.events
Expand Down

0 comments on commit e774838

Please sign in to comment.