oops
This commit is contained in:
parent
1506c60afd
commit
c19b126c07
|
@ -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 <div>
|
||||
<div className="d-flex flex-row justify-content-between align-items-center">
|
||||
<div>
|
||||
|
|
|
@ -49,7 +49,7 @@ function ChapterDisplay({ chapter, user, handleClick, expanded }: {
|
|||
</div>
|
||||
<SmoothCollapse expanded={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 <div key={id}>
|
||||
<div className="d-flex flex-row justify-content-between align-items-center">
|
||||
|
|
Loading…
Reference in New Issue