diff --git a/src/games/GameDisplay.tsx b/src/games/GameDisplay.tsx index 00b38cc..5daee9c 100644 --- a/src/games/GameDisplay.tsx +++ b/src/games/GameDisplay.tsx @@ -2,11 +2,7 @@ import { useUser } from "../user-context"; function GameDisplay({ record: { title, Game, id } }: { record: GameRecord }) { const { user } = useUser(); - const completed = user?.tests.some((t) => ( - // TODO: Or if it's in the locally stored (unposted test results) - (t.done === true) && (t.id === id) - )); - console.log({ id, completed, tests: user?.tests }); + const completed = user?.tests.some((t) => t.done && t.id === id); return
diff --git a/src/games/GamesBrowser.tsx b/src/games/GamesBrowser.tsx index 915d19c..24e5bcf 100644 --- a/src/games/GamesBrowser.tsx +++ b/src/games/GamesBrowser.tsx @@ -49,7 +49,7 @@ function ChapterDisplay({ chapter, user, handleClick, expanded }: {
{chapter.items.map(({ id, title, Game }) => { - const done = user && user.tests.some(t => t.id === id); + const done = user?.tests.some(t => t.done && t.id === id); const open = opened === id; return