diff --git a/frontend/src/config/apps.ts b/frontend/src/config/apps.ts index 034a2c3..0d85d2d 100644 --- a/frontend/src/config/apps.ts +++ b/frontend/src/config/apps.ts @@ -16,8 +16,8 @@ export type App = { export const APPS: App[] = [ { id: 'videos', - name: 'Video Library', - description: 'Browse long-form videos from your trusted kid-friendly channels, already filtered to longer than ten minutes.', + name: 'Watch Videos', + description: 'Browse long-form videos from your trusted kid-friendly channels.', cta: 'Open Videos', link: '/videos', component: VideoApp diff --git a/frontend/src/hooks/useTimeLimit.ts b/frontend/src/hooks/useTimeLimit.ts index 9fb2f58..0a2b6b0 100644 --- a/frontend/src/hooks/useTimeLimit.ts +++ b/frontend/src/hooks/useTimeLimit.ts @@ -33,13 +33,6 @@ export function useTimeLimit(): UseTimeLimitReturn { const startTimeRef = useRef(null); const lastUpdateRef = useRef(Date.now()); - // Fetch limit from server on mount - useEffect(() => { - getDailyLimit().then(limit => { - setDailyLimit(limit); - }); - }, []); - // Update state from localStorage and cached server limit const updateState = useCallback(() => { setDailyLimit(getDailyLimitSync()); @@ -48,6 +41,15 @@ export function useTimeLimit(): UseTimeLimitReturn { setLimitReached(isLimitReached()); }, []); + // Fetch limit from server on mount + useEffect(() => { + getDailyLimit().then(limit => { + setDailyLimit(limit); + // Immediately recalculate limitReached with the correct server limit + updateState(); + }); + }, [updateState]); + // Start tracking time const startTracking = useCallback(() => { if (limitReached) { diff --git a/frontend/src/pages/LandingPage.tsx b/frontend/src/pages/LandingPage.tsx index 8fe60fa..ec3020a 100644 --- a/frontend/src/pages/LandingPage.tsx +++ b/frontend/src/pages/LandingPage.tsx @@ -5,11 +5,6 @@ import './LandingPage.css'; export function LandingPage() { return (
-
-

Welcome to Kiddos

-

Select an app below to get started.

-
-
{APPS.map(app => (