@yourself_id/siwys-react-js 0.0.24-sapp-106-export-qr-code.0 → 0.0.24

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/index.mjs CHANGED
@@ -1019,7 +1019,7 @@ var InstructionsWrapper = styled7.div(_templateObject20());
1019
1019
  var InstructionsSet = styled7.div(_templateObject21());
1020
1020
  var List = styled7.ol(_templateObject22());
1021
1021
  var SignInWithYourSelf = function(param) {
1022
- var createChallengeUrl = param.createChallengeUrl, checkAuthUrl = param.checkAuthUrl;
1022
+ var createChallengeUrl = param.createChallengeUrl, pollForAuthUrl = param.pollForAuthUrl, _param_pollingIntervalSec = param.pollingIntervalSec, pollingIntervalSec = _param_pollingIntervalSec === void 0 ? 5 : _param_pollingIntervalSec;
1023
1023
  var _useState2 = _sliced_to_array(useState2(""), 2), challengeDid = _useState2[0], setChallengeDid = _useState2[1];
1024
1024
  var _useState21 = _sliced_to_array(useState2(""), 2), challengeUrl = _useState21[0], setChallengeUrl = _useState21[1];
1025
1025
  var _useState22 = _sliced_to_array(useState2(false), 2), isAuthenticated = _useState22[0], setIsAuthenticated = _useState22[1];
@@ -1034,10 +1034,10 @@ var SignInWithYourSelf = function(param) {
1034
1034
  });
1035
1035
  }, []);
1036
1036
  useEffect(function() {
1037
- if (!challengeDid || isAuthenticated) return;
1037
+ if (!pollForAuthUrl || !challengeDid || isAuthenticated) return;
1038
1038
  var interval = setInterval(/*#__PURE__*/ _async_to_generator(function() {
1039
1039
  return _ts_generator(this, function(_state) {
1040
- fetch(checkAuthUrl + "?challenge=".concat(challengeDid)).then(function(resp) {
1040
+ fetch(pollForAuthUrl + "?challenge=".concat(challengeDid)).then(function(resp) {
1041
1041
  if (resp.status === 200) {
1042
1042
  return resp.json();
1043
1043
  }
@@ -1053,13 +1053,14 @@ var SignInWithYourSelf = function(param) {
1053
1053
  2
1054
1054
  ];
1055
1055
  });
1056
- }), 5e3);
1056
+ }), pollingIntervalSec * 1e3);
1057
1057
  return function() {
1058
1058
  clearInterval(interval);
1059
1059
  };
1060
1060
  }, [
1061
1061
  challengeDid,
1062
- isAuthenticated
1062
+ isAuthenticated,
1063
+ pollForAuthUrl
1063
1064
  ]);
1064
1065
  return /* @__PURE__ */ React18.createElement(Wrapper4, null, /* @__PURE__ */ React18.createElement(GlobalStyle, null), /* @__PURE__ */ React18.createElement(ModalWrapper, null, isAuthenticated && /* @__PURE__ */ React18.createElement(Success_default, null), !isAuthenticated && /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(Challenge_default, {
1065
1066
  challengeUrl: challengeUrl