@web3auth/modal 9.0.1 → 9.1.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.
@@ -346,7 +346,7 @@ class Web3Auth extends noModal.Web3AuthNoModal {
346
346
  Object.keys(this.walletAdapters).forEach(async adapterName => {
347
347
  const adapter = this.walletAdapters[adapterName];
348
348
  if ((adapter === null || adapter === void 0 ? void 0 : adapter.type) === base.ADAPTER_CATEGORY.EXTERNAL) {
349
- base.log.debug("init external wallet", this.cachedAdapter, adapterName);
349
+ base.log.debug("init external wallet", this.cachedAdapter, adapterName, adapter.status);
350
350
  this.subscribeToAdapterEvents(adapter);
351
351
  // we are not initializing cached adapter here as it is already being initialized in initModal before.
352
352
  if (this.cachedAdapter === adapterName) {
@@ -365,7 +365,8 @@ class Web3Auth extends noModal.Web3AuthNoModal {
365
365
  });
366
366
  return undefined;
367
367
  }).catch(error => base.log.error(error, "error while initializing adapter", adapterName));
368
- } else if (adapter.status === base.ADAPTER_STATUS.READY) {
368
+ } else if (adapter.status === base.ADAPTER_STATUS.READY || adapter.status === base.ADAPTER_STATUS.CONNECTING) {
369
+ // we use connecting status for wallet connect
369
370
  const adapterModalConfig = this.modalConfig.adapters[adapterName];
370
371
  adaptersConfig[adapterName] = _objectSpread(_objectSpread({}, adapterModalConfig), {}, {
371
372
  isInjected: adapter.isInjected
@@ -344,7 +344,7 @@ class Web3Auth extends Web3AuthNoModal {
344
344
  Object.keys(this.walletAdapters).forEach(async adapterName => {
345
345
  const adapter = this.walletAdapters[adapterName];
346
346
  if ((adapter === null || adapter === void 0 ? void 0 : adapter.type) === ADAPTER_CATEGORY.EXTERNAL) {
347
- log.debug("init external wallet", this.cachedAdapter, adapterName);
347
+ log.debug("init external wallet", this.cachedAdapter, adapterName, adapter.status);
348
348
  this.subscribeToAdapterEvents(adapter);
349
349
  // we are not initializing cached adapter here as it is already being initialized in initModal before.
350
350
  if (this.cachedAdapter === adapterName) {
@@ -363,7 +363,8 @@ class Web3Auth extends Web3AuthNoModal {
363
363
  });
364
364
  return undefined;
365
365
  }).catch(error => log.error(error, "error while initializing adapter", adapterName));
366
- } else if (adapter.status === ADAPTER_STATUS.READY) {
366
+ } else if (adapter.status === ADAPTER_STATUS.READY || adapter.status === ADAPTER_STATUS.CONNECTING) {
367
+ // we use connecting status for wallet connect
367
368
  const adapterModalConfig = this.modalConfig.adapters[adapterName];
368
369
  adaptersConfig[adapterName] = _objectSpread(_objectSpread({}, adapterModalConfig), {}, {
369
370
  isInjected: adapter.isInjected
package/dist/modal.cjs.js CHANGED
@@ -477,7 +477,7 @@ class Web3Auth extends no_modal_namespaceObject.Web3AuthNoModal {
477
477
  Object.keys(this.walletAdapters).forEach(async adapterName => {
478
478
  const adapter = this.walletAdapters[adapterName];
479
479
  if ((adapter === null || adapter === void 0 ? void 0 : adapter.type) === base_.ADAPTER_CATEGORY.EXTERNAL) {
480
- base_.log.debug("init external wallet", this.cachedAdapter, adapterName);
480
+ base_.log.debug("init external wallet", this.cachedAdapter, adapterName, adapter.status);
481
481
  this.subscribeToAdapterEvents(adapter);
482
482
  // we are not initializing cached adapter here as it is already being initialized in initModal before.
483
483
  if (this.cachedAdapter === adapterName) {
@@ -496,7 +496,8 @@ class Web3Auth extends no_modal_namespaceObject.Web3AuthNoModal {
496
496
  });
497
497
  return undefined;
498
498
  }).catch(error => base_.log.error(error, "error while initializing adapter", adapterName));
499
- } else if (adapter.status === base_.ADAPTER_STATUS.READY) {
499
+ } else if (adapter.status === base_.ADAPTER_STATUS.READY || adapter.status === base_.ADAPTER_STATUS.CONNECTING) {
500
+ // we use connecting status for wallet connect
500
501
  const adapterModalConfig = this.modalConfig.adapters[adapterName];
501
502
  adaptersConfig[adapterName] = objectSpread2_default()(objectSpread2_default()({}, adapterModalConfig), {}, {
502
503
  isInjected: adapter.isInjected
package/dist/modal.esm.js CHANGED
@@ -418,7 +418,7 @@ class Web3Auth extends Web3AuthNoModal {
418
418
  Object.keys(this.walletAdapters).forEach(async adapterName => {
419
419
  const adapter = this.walletAdapters[adapterName];
420
420
  if ((adapter === null || adapter === void 0 ? void 0 : adapter.type) === ADAPTER_CATEGORY.EXTERNAL) {
421
- log.debug("init external wallet", this.cachedAdapter, adapterName);
421
+ log.debug("init external wallet", this.cachedAdapter, adapterName, adapter.status);
422
422
  this.subscribeToAdapterEvents(adapter);
423
423
  // we are not initializing cached adapter here as it is already being initialized in initModal before.
424
424
  if (this.cachedAdapter === adapterName) {
@@ -437,7 +437,8 @@ class Web3Auth extends Web3AuthNoModal {
437
437
  });
438
438
  return undefined;
439
439
  }).catch(error => log.error(error, "error while initializing adapter", adapterName));
440
- } else if (adapter.status === ADAPTER_STATUS.READY) {
440
+ } else if (adapter.status === ADAPTER_STATUS.READY || adapter.status === ADAPTER_STATUS.CONNECTING) {
441
+ // we use connecting status for wallet connect
441
442
  const adapterModalConfig = this.modalConfig.adapters[adapterName];
442
443
  adaptersConfig[adapterName] = _objectSpread(_objectSpread({}, adapterModalConfig), {}, {
443
444
  isInjected: adapter.isInjected