Skip to content

Commit

Permalink
return not connected if no connection is found for requested chain (#924
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mholtzman authored Jul 4, 2022
1 parent f899f29 commit 6286304
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main/provider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class Provider extends EventEmitter {
const { type, id } = (targetChain || store('main.currentNetwork'))

const connection = this.connection.connections[type][id]
const chainConnected = (connection.primary?.connected || connection.secondary?.connected)
const chainConnected = (connection?.primary?.connected || connection?.secondary?.connected)

const response = chainConnected
? { result: id.toString() }
Expand All @@ -208,7 +208,7 @@ export class Provider extends EventEmitter {
const { type, id } = (targetChain || store('main.currentNetwork'))

const connection = this.connection.connections[type][id]
const chainConnected = (connection.primary?.connected || connection.secondary?.connected)
const chainConnected = (connection?.primary?.connected || connection?.secondary?.connected)

const response = chainConnected
? { result: intToHex(id) }
Expand Down

0 comments on commit 6286304

Please sign in to comment.