@localstack/appinspector-ui 1.0.119 → 1.0.121

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 {
@@ -15597,8 +15597,8 @@ var StatusMessage = ({
15597
15597
  setEnabling(false);
15598
15598
  }
15599
15599
  };
15600
- if (error instanceof AppInspectorNotFoundError) {
15601
- const isBelowMinimum = localstackVersion !== void 0 && checkEmulatorVersion(localstackVersion) === "below-minimum";
15600
+ const isBelowMinimum = localstackVersion !== void 0 && checkEmulatorVersion(localstackVersion) === "below-minimum";
15601
+ if (isBelowMinimum || error instanceof AppInspectorNotFoundError) {
15602
15602
  return /* @__PURE__ */ jsx130(
15603
15603
  Box7,
15604
15604
  {
@@ -15618,7 +15618,7 @@ var StatusMessage = ({
15618
15618
  sx: { maxWidth: 600, width: "100%" },
15619
15619
  children: [
15620
15620
  /* @__PURE__ */ jsx130(AlertTitle, { sx: { fontWeight: "bold" }, children: "App Inspector Not Available" }),
15621
- /* @__PURE__ */ jsx130(Typography5, { sx: { mb: 2 }, variant: "body2", children: isBelowMinimum ? `App Inspector requires LocalStack ${MINIMUM_EMULATOR_VERSION} or later. You are running version ${localstackVersion}. Please update LocalStack.` : "App Inspector is not available in LocalStack. Ensure LocalStack is up-to-date." }),
15621
+ /* @__PURE__ */ jsx130(Typography5, { sx: { mb: 2 }, variant: "body2", children: isBelowMinimum ? `App Inspector requires LocalStack ${MINIMUM_EMULATOR_VERSION} or later. You are running version ${localstackVersion}. Please update LocalStack.` : `App Inspector requires LocalStack ${MINIMUM_EMULATOR_VERSION} or later. Please update LocalStack.` }),
15622
15622
  /* @__PURE__ */ jsx130(Typography5, { sx: { mb: 1 }, variant: "body2", children: /* @__PURE__ */ jsx130("strong", { children: "Update LocalStack:" }) }),
15623
15623
  /* @__PURE__ */ jsx130(
15624
15624
  Box7,
@@ -31519,7 +31519,49 @@ 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";
31544
+ if (versionCompatibility === "below-minimum") {
31545
+ return /* @__PURE__ */ jsx146(
31546
+ StatusMessage,
31547
+ {
31548
+ localstackVersion,
31549
+ onRetry: handleRetry
31550
+ }
31551
+ );
31552
+ }
31553
+ if (shouldShowStatusMessage) {
31554
+ return /* @__PURE__ */ jsx146(
31555
+ StatusMessage,
31556
+ {
31557
+ error: statusError,
31558
+ localstackVersion,
31559
+ onEnable: handleEnable,
31560
+ onRetry: handleRetry,
31561
+ status
31562
+ }
31563
+ );
31564
+ }
31523
31565
  return /* @__PURE__ */ jsxs136(Fragment14, { children: [
31524
31566
  /* @__PURE__ */ jsxs136(
31525
31567
  Box20,
@@ -31537,7 +31579,7 @@ var SpansListPage = () => {
31537
31579
  width: "100%"
31538
31580
  },
31539
31581
  children: [
31540
- !checking && !shouldShowStatusMessage && /* @__PURE__ */ jsx146(
31582
+ !checking && /* @__PURE__ */ jsx146(
31541
31583
  EmulatorVersionBanner,
31542
31584
  {
31543
31585
  compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
@@ -31547,16 +31589,7 @@ var SpansListPage = () => {
31547
31589
  } : void 0
31548
31590
  }
31549
31591
  ),
31550
- shouldShowStatusMessage ? /* @__PURE__ */ jsx146(
31551
- StatusMessage,
31552
- {
31553
- error: statusError,
31554
- localstackVersion,
31555
- onEnable: handleEnable,
31556
- onRetry: handleRetry,
31557
- status
31558
- }
31559
- ) : /* @__PURE__ */ jsx146(
31592
+ /* @__PURE__ */ jsx146(
31560
31593
  SpansList,
31561
31594
  {
31562
31595
  clearingSpans,