/** * Unified screen-readiness signal for ReadyGate. * Marks app content as ready once when condition becomes true. */ "use client"; import { useEffect, useRef } from "react"; import { useAppStore } from "@/store/app-store"; export function useScreenReady(ready: boolean) { const setAppContentReady = useAppStore((s) => s.setAppContentReady); const markedRef = useRef(false); useEffect(() => { if (!ready || markedRef.current) return; markedRef.current = true; setAppContentReady(true); }, [ready, setAppContentReady]); }