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