This commit is contained in:
lingdocs 2021-09-18 23:58:25 -04:00
parent ccac58e5eb
commit 17212a989a
2 changed files with 2 additions and 0 deletions

View File

@ -57,6 +57,7 @@ function GameCore<T>({ questions, Display, timeLimit, Instructions, studyLink, i
id, id,
}; };
console.log("will post result", JSON.stringify(result)); console.log("will post result", JSON.stringify(result));
// TODO: Check not showing up - should show up immediately whether online or not
postTestResults([result]) postTestResults([result])
.then((res) => { .then((res) => {
if (res.ok) { if (res.ok) {

View File

@ -4,6 +4,7 @@ import { useUser } from "../user-context";
function GameDisplay({ record: { title, Game, id } }: { record: GameRecord }) { function GameDisplay({ record: { title, Game, id } }: { record: GameRecord }) {
const { user } = useUser(); const { user } = useUser();
const completed = user?.tests.some((t) => ( const completed = user?.tests.some((t) => (
// TODO: Or if it's in the locally stored (unposted test results)
(t.done === true) && (t.id === id) (t.done === true) && (t.id === id)
)); ));
return <div> return <div>