MCPcopy Create free account
hub / github.com/code100x/daily-code / RedirectToLastSolved

Function RedirectToLastSolved

apps/web/components/RedirectToLastSolved.tsx:7–21  ·  view source on GitHub ↗
({ trackId }: { trackId: string })

Source from the content-addressed store, hash-verified

5import { getFirstProblemForTrack } from "./utils";
6
7export const RedirectToLastSolved = ({ trackId }: { trackId: string }) => {
8 const router = useRouter();
9
10 useEffect(() => {
11 getFirstProblemForTrack(trackId).then((problemId) => {
12 router.replace(`/tracks/${trackId}/${problemId}`);
13 });
14 }, [trackId]);
15
16 return (
17 <div>
18 <Loader />
19 </div>
20 );
21};

Callers

nothing calls this directly

Calls 1

getFirstProblemForTrackFunction · 0.90

Tested by

no test coverage detected