Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Fix WC autoconnect #1157

Merged
merged 5 commits into from
Jul 1, 2020
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/utils/autoconnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,9 @@ const getWCIfConnected = async (): Promise<unknown> => {
infuraId: INFURA_ID,
bridge: WALLET_CONNECT_BRIDGE,
})

if (!provider.wc.connected) return null

try {
await new Promise((resolve, reject) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
provider.wc.on('transport_open', (error: Error, event: any) => {
if (error) reject(error)
else resolve(event)
})
})

await Promise.race([
// some time for connection to settle
delay(250),
Expand Down