diff --git a/frontend/src/routes/_account.plan.index.tsx b/frontend/src/routes/_account.plan.index.tsx index bcc9499b6..62eb8840a 100644 --- a/frontend/src/routes/_account.plan.index.tsx +++ b/frontend/src/routes/_account.plan.index.tsx @@ -45,37 +45,37 @@ function Plan(): React.ReactElement { } const ref = useRef(null); - const [height, setHeight] = useState("0px"); + const [iframeHeight, setIframeHeight] = useState("0px"); // Poll the size of the iframe content and set the height // This will only work where the iframe is served from the same origin - const doHeight = useCallback(() => { + const calculateHeight = useCallback(() => { const height = ref.current?.contentWindow?.document.body.parentElement?.scrollHeight; if (height) { - setHeight(`${height}px`); + setIframeHeight(`${height}px`); } else { - setHeight("500px"); + setIframeHeight("500px"); } }, []); useEffect(() => { - doHeight(); + calculateHeight(); const interval = setInterval(() => { - doHeight(); + calculateHeight(); }, 1000); return () => clearInterval(interval); - }, [doHeight]); + }, [calculateHeight]); return (