diff --git a/packages/beacon-dapp/src/transports/DappWalletConnectTransport.ts b/packages/beacon-dapp/src/transports/DappWalletConnectTransport.ts index 1d6d432c2..f3118b920 100644 --- a/packages/beacon-dapp/src/transports/DappWalletConnectTransport.ts +++ b/packages/beacon-dapp/src/transports/DappWalletConnectTransport.ts @@ -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 diff --git a/packages/beacon-transport-walletconnect/src/WalletConnectTransport.ts b/packages/beacon-transport-walletconnect/src/WalletConnectTransport.ts index e69c99e8b..2de53c626 100644 --- a/packages/beacon-transport-walletconnect/src/WalletConnectTransport.ts +++ b/packages/beacon-transport-walletconnect/src/WalletConnectTransport.ts @@ -27,7 +27,7 @@ export class WalletConnectTransport< > extends Transport { public readonly type: TransportType = TransportType.WALLETCONNECT - private isReady = new ExposedPromise() + protected isReady = new ExposedPromise() constructor( name: string, diff --git a/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts b/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts index 4d16c1638..1a8f2177a 100644 --- a/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts +++ b/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts @@ -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') }