@aptos-labs/wallet-adapter-core 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @aptos-labs/wallet-adapter-core
2
2
 
3
+ ## 3.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e1e9eb2: ['Bug fix'] Use current connected wallet to compare to the selected wallet before connecting to a wallet
8
+
3
9
  ## 3.3.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -435,14 +435,14 @@ var WalletCore = class extends import_eventemitter32.default {
435
435
  }
436
436
  }
437
437
  async connect(walletName) {
438
- var _a;
438
+ var _a, _b;
439
439
  const selectedWallet = (_a = this._wallets) == null ? void 0 : _a.find(
440
440
  (wallet) => wallet.name === walletName
441
441
  );
442
442
  if (!selectedWallet)
443
443
  return;
444
444
  if (this._connected) {
445
- if (selectedWallet.name === walletName)
445
+ if (((_b = this._wallet) == null ? void 0 : _b.name) === walletName)
446
446
  throw new WalletConnectionError(
447
447
  `${walletName} wallet is already connected`
448
448
  ).message;
package/dist/index.mjs CHANGED
@@ -401,14 +401,14 @@ var WalletCore = class extends EventEmitter2 {
401
401
  }
402
402
  }
403
403
  async connect(walletName) {
404
- var _a;
404
+ var _a, _b;
405
405
  const selectedWallet = (_a = this._wallets) == null ? void 0 : _a.find(
406
406
  (wallet) => wallet.name === walletName
407
407
  );
408
408
  if (!selectedWallet)
409
409
  return;
410
410
  if (this._connected) {
411
- if (selectedWallet.name === walletName)
411
+ if (((_b = this._wallet) == null ? void 0 : _b.name) === walletName)
412
412
  throw new WalletConnectionError(
413
413
  `${walletName} wallet is already connected`
414
414
  ).message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-labs/wallet-adapter-core",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Aptos Wallet Adapter Core",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/src/WalletCore.ts CHANGED
@@ -207,7 +207,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
207
207
 
208
208
  if (this._connected) {
209
209
  // if the selected wallet is already connected, we don't need to connect again
210
- if (selectedWallet.name === walletName)
210
+ if (this._wallet?.name === walletName)
211
211
  throw new WalletConnectionError(
212
212
  `${walletName} wallet is already connected`
213
213
  ).message;