@depay/widgets 12.0.9 → 12.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.
@@ -23776,6 +23776,10 @@
23776
23776
  var _useContext4 = React.useContext(WalletContext),
23777
23777
  wallet = _useContext4.wallet,
23778
23778
  account = _useContext4.account;
23779
+ var _useState = React.useState(false),
23780
+ _useState2 = _slicedToArray(_useState, 2),
23781
+ loggingIn = _useState2[0],
23782
+ setLoggingIn = _useState2[1];
23779
23783
  if (!wallet) {
23780
23784
  return null;
23781
23785
  }
@@ -23810,6 +23814,7 @@
23810
23814
  };
23811
23815
  }
23812
23816
  var login = function login() {
23817
+ setLoggingIn(true);
23813
23818
  var messageToSign;
23814
23819
  if (typeof message == 'function') {
23815
23820
  messageToSign = message(account);
@@ -23825,9 +23830,14 @@
23825
23830
  account: account,
23826
23831
  wallet: wallet
23827
23832
  });
23828
- })["catch"](setError);
23833
+ setLoggingIn(false);
23834
+ })["catch"](function (error) {
23835
+ setLoggingIn(false);
23836
+ setError(error);
23837
+ });
23829
23838
  })["catch"](function (error) {
23830
- if (error && error.code && error.code == 4001) ; else {
23839
+ setLoggingIn(false);
23840
+ if (error && error.code && (error.code == 4001 || error.code == 'ACTION_REJECTED')) ; else {
23831
23841
  setError(error);
23832
23842
  }
23833
23843
  });
@@ -23849,7 +23859,19 @@
23849
23859
  }, "Please click \"Log in\" and sign the message with your connected wallet."))),
23850
23860
  footer: /*#__PURE__*/React__default["default"].createElement("div", {
23851
23861
  className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
23852
- }, /*#__PURE__*/React__default["default"].createElement("button", {
23862
+ }, loggingIn && /*#__PURE__*/React__default["default"].createElement("div", {
23863
+ className: "PaddingTopXS PaddingBottomXS",
23864
+ style: {
23865
+ height: '58px'
23866
+ }
23867
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
23868
+ className: "PaddingTopS PaddingBottomS TextCenter"
23869
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
23870
+ className: "Loading Icon medium",
23871
+ style: {
23872
+ position: 'relative'
23873
+ }
23874
+ }))), !loggingIn && /*#__PURE__*/React__default["default"].createElement("button", {
23853
23875
  className: "ButtonPrimary",
23854
23876
  onClick: login
23855
23877
  }, "Log in"))