Skip to content

Commit

Permalink
fix: walletConnect redirect issues after sending a switchEthereumChai…
Browse files Browse the repository at this point in the history
…n request and right after it a personal_sign request
  • Loading branch information
omridan159 committed Feb 1, 2024
1 parent 4dd9073 commit 6b74aa1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/core/WalletConnect/WalletConnectV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,14 @@ class WalletConnect2Session {
);
}

this.needsRedirect(id);
const requests = this.web3Wallet.getPendingSessionRequests() || [];

const hasPendingSignRequest =
requests[0]?.params?.request?.method === 'personal_sign';

if (!hasPendingSignRequest) {
this.needsRedirect(id);
}
};

rejectRequest = async ({ id, error }: { id: string; error: unknown }) => {
Expand Down

0 comments on commit 6b74aa1

Please sign in to comment.