diff --git a/frontend/src/components/business/LabelStudioPreloader.tsx b/frontend/src/components/business/LabelStudioPreloader.tsx new file mode 100644 index 0000000..0bc8db6 --- /dev/null +++ b/frontend/src/components/business/LabelStudioPreloader.tsx @@ -0,0 +1,35 @@ +import { useEffect, useState } from "react"; + +const PRELOAD_URL = "/lsf/lsf.html"; + +export default function LabelStudioPreloader() { + const [shouldLoad, setShouldLoad] = useState(false); + + useEffect(() => { + // Delay preloading slightly to avoid contending with initial page load resources + // Using 2000ms (2 seconds) as a reasonable idle time approximation + const timer = setTimeout(() => { + setShouldLoad(true); + }, 2000); + + return () => clearTimeout(timer); + }, []); + + if (!shouldLoad) return null; + + return ( +