@depay/widgets 12.12.5 → 12.12.6

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/esm/index.js CHANGED
@@ -24893,7 +24893,7 @@ var PaymentRoutingProvider = (function (props) {
24893
24893
  amountsMissing = _useContext4.amountsMissing;
24894
24894
  var getPaymentRoutes = /*#__PURE__*/function () {
24895
24895
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
24896
- var updatable, slowRoutingTimeout, firstRouteDisplayed;
24896
+ var updatable, slowRoutingTimeout;
24897
24897
  return regenerator.wrap(function _callee$(_context) {
24898
24898
  while (1) {
24899
24899
  switch (_context.prev = _context.next) {
@@ -24907,33 +24907,11 @@ var PaymentRoutingProvider = (function (props) {
24907
24907
  case 3:
24908
24908
  slowRoutingTimeout = setTimeout(function () {
24909
24909
  setSlowRouting(true);
24910
- }, 4000);
24910
+ }, 3000);
24911
24911
  _context.next = 6;
24912
24912
  return routePayments(Object.assign({}, configuration, {
24913
24913
  accept: props.accept,
24914
- account: account,
24915
- drip: function drip(route) {
24916
- if (amountsMissing) {
24917
- return;
24918
- }
24919
- if (route.fromToken.address !== route.toToken.address && !Blockchains[route.blockchain].tokens.find(function (token) {
24920
- return token.address.toLowerCase() === route.fromToken.address.toLowerCase();
24921
- })) {
24922
- return;
24923
- }
24924
- if (allRoutesLoaded) {
24925
- return;
24926
- }
24927
- if (route.approvalRequired) {
24928
- return;
24929
- }
24930
- if (firstRouteDisplayed) {
24931
- return;
24932
- }
24933
- firstRouteDisplayed = true;
24934
- clearInterval(slowRoutingTimeout);
24935
- setUpdatedRoutes([route]);
24936
- }
24914
+ account: account
24937
24915
  })).then(function (routes) {
24938
24916
  setUpdatedRoutes(routes);
24939
24917
  setAllRoutesLoadedInternal(true);
@@ -25037,17 +25015,20 @@ var PaymentRoutingProvider = (function (props) {
25037
25015
  };
25038
25016
  useEffect(function () {
25039
25017
  var timeout = setTimeout(function () {
25040
- setReloadCount(reloadCount + 1);
25041
- getPaymentRoutes({
25042
- allRoutes: allRoutes,
25043
- selectedRoute: selectedRoute,
25044
- updatable: updatable
25045
- });
25018
+ if (allRoutesLoaded) {
25019
+ // do not reload if first routes have not been loaded yet
25020
+ setReloadCount(reloadCount + 1);
25021
+ getPaymentRoutes({
25022
+ allRoutes: allRoutes,
25023
+ selectedRoute: selectedRoute,
25024
+ updatable: updatable
25025
+ });
25026
+ }
25046
25027
  }, 15000);
25047
25028
  return function () {
25048
25029
  return clearTimeout(timeout);
25049
25030
  };
25050
- }, [reloadCount, allRoutes, selectedRoute, updatable]);
25031
+ }, [reloadCount, allRoutes, allRoutesLoaded, selectedRoute, updatable]);
25051
25032
  useEffect(function () {
25052
25033
  if (recover) {
25053
25034
  return;