Skip to content

Commit

Permalink
fix: mobile request lost
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaccoSordo committed Aug 8, 2024
1 parent 7ea9b71 commit f89af23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions packages/beacon-dapp/src/dapp-client/DAppClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1075,12 +1075,13 @@ export class DAppClient extends Client {
}

private async checkMakeRequest() {
const isResolved = this._transport.isResolved()
const isWCInstance = isResolved && (await this.transport) instanceof WalletConnectTransport
const isLeader = this.multiTabChannel.isLeader()
const isMobile = isMobileOS(window)

return (
!this._transport.isResolved() ||
(this._transport.isResolved() &&
(!((await this.transport) instanceof WalletConnectTransport) ||
((await this.transport) instanceof WalletConnectTransport &&
this.multiTabChannel.isLeader())))
!isResolved || (isResolved && (!isWCInstance || (isWCInstance && (isLeader || isMobile))))
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ export class WalletConnectCommunicationClient extends CommunicationClient {
})
.then(async () => {
const isLeader = await this.isLeader()
if (!isLeader) {
if (!isLeader && !this.isMobileOS()) {
await this.closeSignClient()
}
})
Expand Down

0 comments on commit f89af23

Please sign in to comment.