@web3auth/modal 8.4.0 → 8.5.0-alpha.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/dist/modal.cjs.js CHANGED
@@ -182,7 +182,7 @@ class Web3Auth extends no_modal_namespaceObject.Web3AuthNoModal {
182
182
  } = projectConfig;
183
183
  this.options.uiConfig = external_lodash_merge_default()(external_lodash_clonedeep_default()(whitelabel), this.options.uiConfig);
184
184
  if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = (0,ui_namespaceObject.getUserLanguage)(this.options.uiConfig.defaultLanguage);
185
- if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "auto";
185
+ if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
186
186
  this.loginModal = new ui_namespaceObject.LoginModal(objectSpread2_default()(objectSpread2_default()({}, this.options.uiConfig), {}, {
187
187
  adapterListener: this
188
188
  }));
@@ -420,8 +420,11 @@ class Web3Auth extends no_modal_namespaceObject.Web3AuthNoModal {
420
420
  this.commonJRPCProvider = await base_provider_namespaceObject.CommonJRPCProvider.getProviderInstance({
421
421
  chainConfig: this.coreOptions.chainConfig
422
422
  });
423
- this.status = base_.ADAPTER_STATUS.READY;
424
423
  await Promise.all(initPromises);
424
+ if (this.status === base_.ADAPTER_STATUS.NOT_READY) {
425
+ this.status = base_.ADAPTER_STATUS.READY;
426
+ this.emit(base_.ADAPTER_EVENTS.READY);
427
+ }
425
428
  const hasExternalWallets = allAdapters.some(adapterName => {
426
429
  var _this$walletAdapters$, _this$modalConfig$ada10;
427
430
  return ((_this$walletAdapters$ = this.walletAdapters[adapterName]) === null || _this$walletAdapters$ === void 0 ? void 0 : _this$walletAdapters$.type) === base_.ADAPTER_CATEGORY.EXTERNAL && ((_this$modalConfig$ada10 = this.modalConfig.adapters) === null || _this$modalConfig$ada10 === void 0 ? void 0 : _this$modalConfig$ada10[adapterName].showOnModal);
package/dist/modal.esm.js CHANGED
@@ -121,7 +121,7 @@ class Web3Auth extends Web3AuthNoModal {
121
121
  } = projectConfig;
122
122
  this.options.uiConfig = merge(clonedeep(whitelabel), this.options.uiConfig);
123
123
  if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = getUserLanguage(this.options.uiConfig.defaultLanguage);
124
- if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "auto";
124
+ if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
125
125
  this.loginModal = new LoginModal(_objectSpread(_objectSpread({}, this.options.uiConfig), {}, {
126
126
  adapterListener: this
127
127
  }));
@@ -359,8 +359,11 @@ class Web3Auth extends Web3AuthNoModal {
359
359
  this.commonJRPCProvider = await CommonJRPCProvider.getProviderInstance({
360
360
  chainConfig: this.coreOptions.chainConfig
361
361
  });
362
- this.status = ADAPTER_STATUS.READY;
363
362
  await Promise.all(initPromises);
363
+ if (this.status === ADAPTER_STATUS.NOT_READY) {
364
+ this.status = ADAPTER_STATUS.READY;
365
+ this.emit(ADAPTER_EVENTS.READY);
366
+ }
364
367
  const hasExternalWallets = allAdapters.some(adapterName => {
365
368
  var _this$walletAdapters$, _this$modalConfig$ada10;
366
369
  return ((_this$walletAdapters$ = this.walletAdapters[adapterName]) === null || _this$walletAdapters$ === void 0 ? void 0 : _this$walletAdapters$.type) === ADAPTER_CATEGORY.EXTERNAL && ((_this$modalConfig$ada10 = this.modalConfig.adapters) === null || _this$modalConfig$ada10 === void 0 ? void 0 : _this$modalConfig$ada10[adapterName].showOnModal);