@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.
@@ -24931,7 +24931,7 @@ var PaymentRoutingProvider = (function (props) {
24931
24931
  amountsMissing = _useContext4.amountsMissing;
24932
24932
  var getPaymentRoutes = /*#__PURE__*/function () {
24933
24933
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
24934
- var updatable, slowRoutingTimeout, firstRouteDisplayed;
24934
+ var updatable, slowRoutingTimeout;
24935
24935
  return regenerator.wrap(function _callee$(_context) {
24936
24936
  while (1) {
24937
24937
  switch (_context.prev = _context.next) {
@@ -24945,33 +24945,11 @@ var PaymentRoutingProvider = (function (props) {
24945
24945
  case 3:
24946
24946
  slowRoutingTimeout = setTimeout(function () {
24947
24947
  setSlowRouting(true);
24948
- }, 4000);
24948
+ }, 3000);
24949
24949
  _context.next = 6;
24950
24950
  return routePayments(Object.assign({}, configuration, {
24951
24951
  accept: props.accept,
24952
- account: account,
24953
- drip: function drip(route) {
24954
- if (amountsMissing) {
24955
- return;
24956
- }
24957
- if (route.fromToken.address !== route.toToken.address && !Blockchains[route.blockchain].tokens.find(function (token) {
24958
- return token.address.toLowerCase() === route.fromToken.address.toLowerCase();
24959
- })) {
24960
- return;
24961
- }
24962
- if (allRoutesLoaded) {
24963
- return;
24964
- }
24965
- if (route.approvalRequired) {
24966
- return;
24967
- }
24968
- if (firstRouteDisplayed) {
24969
- return;
24970
- }
24971
- firstRouteDisplayed = true;
24972
- clearInterval(slowRoutingTimeout);
24973
- setUpdatedRoutes([route]);
24974
- }
24952
+ account: account
24975
24953
  })).then(function (routes) {
24976
24954
  setUpdatedRoutes(routes);
24977
24955
  setAllRoutesLoadedInternal(true);
@@ -25075,17 +25053,20 @@ var PaymentRoutingProvider = (function (props) {
25075
25053
  };
25076
25054
  useEffect(function () {
25077
25055
  var timeout = setTimeout(function () {
25078
- setReloadCount(reloadCount + 1);
25079
- getPaymentRoutes({
25080
- allRoutes: allRoutes,
25081
- selectedRoute: selectedRoute,
25082
- updatable: updatable
25083
- });
25056
+ if (allRoutesLoaded) {
25057
+ // do not reload if first routes have not been loaded yet
25058
+ setReloadCount(reloadCount + 1);
25059
+ getPaymentRoutes({
25060
+ allRoutes: allRoutes,
25061
+ selectedRoute: selectedRoute,
25062
+ updatable: updatable
25063
+ });
25064
+ }
25084
25065
  }, 15000);
25085
25066
  return function () {
25086
25067
  return clearTimeout(timeout);
25087
25068
  };
25088
- }, [reloadCount, allRoutes, selectedRoute, updatable]);
25069
+ }, [reloadCount, allRoutes, allRoutesLoaded, selectedRoute, updatable]);
25089
25070
  useEffect(function () {
25090
25071
  if (recover) {
25091
25072
  return;