Skip to content

Commit

Permalink
bug fix use current connected wallet to compare to the selected walle…
Browse files Browse the repository at this point in the history
…t before connecting to a wallet (#229)
  • Loading branch information
0xmaayan authored Jan 8, 2024
1 parent 0c47324 commit e1e9eb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/happy-kiwis-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aptos-labs/wallet-adapter-core": minor
---

['Bug fix'] Use current connected wallet to compare to the selected wallet before connecting to a wallet
2 changes: 1 addition & 1 deletion packages/wallet-adapter-core/src/WalletCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {

if (this._connected) {
// if the selected wallet is already connected, we don't need to connect again
if (selectedWallet.name === walletName)
if (this._wallet?.name === walletName)
throw new WalletConnectionError(
`${walletName} wallet is already connected`
).message;
Expand Down

0 comments on commit e1e9eb2

Please sign in to comment.