diff --git a/web/components/pages/editor/editor-body.tsx b/web/components/pages/editor/editor-body.tsx index 8afd46bf5..1c775c388 100644 --- a/web/components/pages/editor/editor-body.tsx +++ b/web/components/pages/editor/editor-body.tsx @@ -137,11 +137,14 @@ export const PageEditorBody: React.FC = observer((props) => { // } }; - const interval = setInterval(() => { - fetchDescription(); - }, 15000); + // Fetch the description immediately + fetchDescription(); - return () => clearInterval(interval); + // Then fetch the description every 10 seconds + const intervalId = setInterval(fetchDescription, 10000); + + // Clear the interval when the component is unmounted + return () => clearInterval(intervalId); }, [pageId, projectId, workspaceSlug]); useEffect(() => {