diff --git a/js/libs/ui-shared/src/utils/ErrorBoundary.tsx b/js/libs/ui-shared/src/utils/ErrorBoundary.tsx index 3d771cb9a7..adb8fd9064 100644 --- a/js/libs/ui-shared/src/utils/ErrorBoundary.tsx +++ b/js/libs/ui-shared/src/utils/ErrorBoundary.tsx @@ -10,7 +10,7 @@ import { useRequiredContext } from "./useRequiredContext"; export interface ErrorBoundaryContextValue { error?: Error; - showBoundary: (error: Error) => void; + showBoundary: (error?: Error) => void; } const ErrorBoundaryContext = createNamedContext< @@ -40,7 +40,7 @@ export class ErrorBoundaryProvider extends Component< return { error }; }; - showBoundary = (error: Error) => { + showBoundary = (error?: Error) => { this.setState({ error }); }; diff --git a/js/libs/ui-shared/src/utils/useFetch.ts b/js/libs/ui-shared/src/utils/useFetch.ts index 89f4eaecf0..09419d44f1 100644 --- a/js/libs/ui-shared/src/utils/useFetch.ts +++ b/js/libs/ui-shared/src/utils/useFetch.ts @@ -26,6 +26,7 @@ export function useFetch( useEffect(() => { const controller = new AbortController(); const { signal } = controller; + showBoundary(); adminClientCall() .then((result) => { if (!signal.aborted) {