From f89af23d9eb978e908d9f49437504f3bf417d782 Mon Sep 17 00:00:00 2001 From: IsaccoSordo Date: Thu, 8 Aug 2024 14:50:39 +0200 Subject: [PATCH] fix: mobile request lost --- packages/beacon-dapp/src/dapp-client/DAppClient.ts | 11 ++++++----- .../WalletConnectCommunicationClient.ts | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/beacon-dapp/src/dapp-client/DAppClient.ts b/packages/beacon-dapp/src/dapp-client/DAppClient.ts index e155c20f5..19bb74c94 100644 --- a/packages/beacon-dapp/src/dapp-client/DAppClient.ts +++ b/packages/beacon-dapp/src/dapp-client/DAppClient.ts @@ -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)))) ) } diff --git a/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts b/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts index 2c43bc887..7cc132a54 100644 --- a/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts +++ b/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts @@ -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() } })