Skip to content

Commit

Permalink
Merge pull request #836 from airgap-it/fix/requests_block_secondary_tab
Browse files Browse the repository at this point in the history
fix: requests blocked
  • Loading branch information
IsaccoSordo authored Nov 19, 2024
2 parents 826d926 + 01e8e61 commit d76425a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ export class DappWalletConnectTransport extends WalletConnectTransport<
)
this.client.listenForChannelOpening(async (peer: ExtendedWalletConnectPairingResponse) => {
await this.addPeer(peer)

this._isConnected = isMobileOS(window) || (await isLeader())
? TransportStatus.CONNECTED
: TransportStatus.SECONDARY_TAB_CONNECTED

this.isReady.isPending() && this.isReady.resolve(true)

if (this.newPeerListener) {
this.newPeerListener(peer)
this.newPeerListener = undefined // TODO: Remove this once we use the id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class WalletConnectTransport<
> extends Transport<T, K, WalletConnectCommunicationClient> {
public readonly type: TransportType = TransportType.WALLETCONNECT

private isReady = new ExposedPromise<boolean>()
protected isReady = new ExposedPromise<boolean>()

constructor(
name: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,8 @@ export class WalletConnectCommunicationClient extends CommunicationClient {
)
))
await this.closeSignClient()
await this.storage.resetState()
this.storage.notify('RESET')
this.isMobileOS() && await this.storage.resetState()
this.isMobileOS() && this.storage.notify('RESET')

}

Expand Down

0 comments on commit d76425a

Please sign in to comment.