@wise/dynamic-flow-client 3.16.7 → 3.17.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.
package/build/main.js CHANGED
@@ -6887,10 +6887,11 @@ var getStepPolling = ({
6887
6887
  onFailure();
6888
6888
  }
6889
6889
  };
6890
+ poll();
6890
6891
  const intervalRef = setInterval(poll, delay * 1e3);
6891
6892
  const stop = () => {
6892
- abortController.abort();
6893
6893
  clearTimeout(intervalRef);
6894
+ abortController.abort();
6894
6895
  };
6895
6896
  return { stop };
6896
6897
  };
@@ -14264,6 +14265,7 @@ function useExternal2(url) {
14264
14265
  // src/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.tsx
14265
14266
  var import_react31 = require("react");
14266
14267
  function useExternalStepPolling(polling, onAction) {
14268
+ var _a, _b;
14267
14269
  const httpClient = useHttpClient();
14268
14270
  const asyncFn = (0, import_react31.useMemo)(() => {
14269
14271
  if (polling) {
@@ -14306,7 +14308,7 @@ function useExternalStepPolling(polling, onAction) {
14306
14308
  );
14307
14309
  usePolling({
14308
14310
  asyncFn,
14309
- interval: (polling == null ? void 0 : polling.delay) || (polling == null ? void 0 : polling.interval) || 0,
14311
+ delay: (_b = (_a = polling == null ? void 0 : polling.delay) != null ? _a : polling == null ? void 0 : polling.interval) != null ? _b : 0,
14310
14312
  maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
14311
14313
  maxConsecutiveFails: (polling == null ? void 0 : polling.maxConsecutiveFails) || 0,
14312
14314
  onPollingResponse,
@@ -18420,7 +18422,7 @@ function hasStringMessage(value) {
18420
18422
  var import_react56 = require("react");
18421
18423
  function usePolling({
18422
18424
  asyncFn,
18423
- interval,
18425
+ delay,
18424
18426
  maxAttempts,
18425
18427
  maxConsecutiveFails,
18426
18428
  onPollingResponse,
@@ -18439,13 +18441,14 @@ function usePolling({
18439
18441
  [asyncFn, maxAttempts, maxConsecutiveFails]
18440
18442
  );
18441
18443
  (0, import_react56.useEffect)(() => {
18442
- if (interval > 0) {
18444
+ if (delay > 0) {
18445
+ poll();
18443
18446
  const intervalReference = setInterval(() => {
18444
18447
  poll();
18445
- }, interval);
18448
+ }, delay);
18446
18449
  return () => clearInterval(intervalReference);
18447
18450
  }
18448
- }, [poll, interval]);
18451
+ }, [poll, delay]);
18449
18452
  (0, import_react56.useEffect)(() => {
18450
18453
  onPollingResponseReference.current = onPollingResponse;
18451
18454
  onFailureReference.current = onFailure;
@@ -18489,6 +18492,7 @@ var usePrevious = (value) => {
18489
18492
  // src/legacy/common/hooks/useStepPolling/useStepPolling.tsx
18490
18493
  var import_react58 = require("react");
18491
18494
  function useStepPolling(polling, onAction) {
18495
+ var _a, _b;
18492
18496
  const httpClient = useHttpClient();
18493
18497
  const asyncFn = (0, import_react58.useMemo)(() => {
18494
18498
  if (polling) {
@@ -18515,7 +18519,7 @@ function useStepPolling(polling, onAction) {
18515
18519
  );
18516
18520
  usePolling({
18517
18521
  asyncFn,
18518
- interval: 1e3 * ((polling == null ? void 0 : polling.interval) || 0),
18522
+ delay: 1e3 * ((_b = (_a = polling == null ? void 0 : polling.delay) != null ? _a : polling == null ? void 0 : polling.interval) != null ? _b : 0),
18519
18523
  maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
18520
18524
  maxConsecutiveFails: 1,
18521
18525
  onPollingResponse,