@localstack/appinspector-ui 1.0.119 → 1.0.120

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.js CHANGED
@@ -2414,7 +2414,7 @@ var init_event_streams = __esm({
2414
2414
 
2415
2415
  // src/pages/spans-list-page.tsx
2416
2416
  import { Box as Box20 } from "@mui/material";
2417
- import { useCallback as useCallback12, useState as useState17 } from "react";
2417
+ import { useCallback as useCallback12, useEffect as useEffect22, useRef as useRef18, useState as useState17 } from "react";
2418
2418
 
2419
2419
  // src/api/errors.ts
2420
2420
  var AppInspectorDisabledError = class extends Error {
@@ -31519,6 +31519,27 @@ var SpansListPage = () => {
31519
31519
  clearFetchError();
31520
31520
  void checkStatus();
31521
31521
  }, [api, checkStatus, clearFetchError]);
31522
+ const isDelayedRefetchRef = useRef18(false);
31523
+ const delayedRefetchTimerRef = useRef18();
31524
+ const prevFetchingForwardRef = useRef18(false);
31525
+ useEffect22(() => {
31526
+ const wasFetching = prevFetchingForwardRef.current;
31527
+ prevFetchingForwardRef.current = fetchingForward;
31528
+ if (wasFetching && !fetchingForward) {
31529
+ if (isDelayedRefetchRef.current) {
31530
+ isDelayedRefetchRef.current = false;
31531
+ } else {
31532
+ clearTimeout(delayedRefetchTimerRef.current);
31533
+ delayedRefetchTimerRef.current = setTimeout(() => {
31534
+ isDelayedRefetchRef.current = true;
31535
+ fetchForward();
31536
+ }, 2e3);
31537
+ }
31538
+ }
31539
+ return () => {
31540
+ clearTimeout(delayedRefetchTimerRef.current);
31541
+ };
31542
+ }, [fetchingForward, fetchForward]);
31522
31543
  const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
31523
31544
  return /* @__PURE__ */ jsxs136(Fragment14, { children: [
31524
31545
  /* @__PURE__ */ jsxs136(