diff --git a/enterprise/frontend/src/embedding-sdk/hooks/private/use-load-static-question.ts b/enterprise/frontend/src/embedding-sdk/hooks/private/use-load-static-question.ts index f288b67d46bfa70119e4107334932b5124ea3326..3abe084469d3c4298ae5264bf6478f0b4a90bf1a 100644 --- a/enterprise/frontend/src/embedding-sdk/hooks/private/use-load-static-question.ts +++ b/enterprise/frontend/src/embedding-sdk/hooks/private/use-load-static-question.ts @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from "react"; +import { useEffect, useState } from "react"; import { loadStaticQuestion } from "embedding-sdk/lib/load-static-question"; import type { GenericErrorResponse } from "metabase/lib/errors"; @@ -17,17 +17,6 @@ export function useLoadStaticQuestion( questionId: number | null, parameterValues?: Record<string, string | number>, ) { - // This is a hack around strict mode calling the useEffect twice -> - // the first request is being cancelled and we render a error state for a few renders - // This needs to start at true, it needs to bypass the double use effect of strict mode - // See https://github.com/metabase/metabase/issues/49620 for more details on the issue - const isMounted = useRef(true); - useEffect(() => { - return () => { - isMounted.current = false; - }; - }, []); - const [questionState, setQuestionState] = useState<QuestionState>({ loading: false, card: null, @@ -67,10 +56,6 @@ export function useLoadStaticQuestion( error: null, }); } catch (error) { - if (!isMounted.current) { - return; - } - if (typeof error === "object") { setQuestionState({ result: null,