From 73498ed783fd4f891de1e03d1d3d8927452d1cb6 Mon Sep 17 00:00:00 2001 From: IsaccoSordo Date: Thu, 8 Aug 2024 09:26:28 +0200 Subject: [PATCH] fix: app switching --- packages/beacon-dapp/src/dapp-client/DAppClient.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/beacon-dapp/src/dapp-client/DAppClient.ts b/packages/beacon-dapp/src/dapp-client/DAppClient.ts index ef6067219..b4c62ca64 100644 --- a/packages/beacon-dapp/src/dapp-client/DAppClient.ts +++ b/packages/beacon-dapp/src/dapp-client/DAppClient.ts @@ -2517,6 +2517,13 @@ export class DAppClient extends Client { id }) + if ( + request.type !== BeaconMessageType.PermissionRequest || + (this._activeAccount.isResolved() && (await this._activeAccount.promise)) + ) { + this.tryToAppSwitch() + } + this.events .emit(messageEvents[BeaconMessageType.PermissionRequest].sent, { walletInfo: await this.getWalletInfo(),