Little fix

This commit is contained in:
aronmal 2023-04-15 12:10:56 +02:00
parent 549d0f1d77
commit b9e72b2a32
Signed by: aronmal
GPG key ID: 816B7707426FC612

View file

@ -48,15 +48,14 @@ export default function Home({ q }: Props) {
}) })
.optional(), .optional(),
}) })
const gamePromise = getAccessToken().then((token) => { const gamePromise = getAccessToken().then((token) =>
console.log(otp, { ...token, pin }) fetch("/api/game/" + (!pin ? "create" : "join"), {
return fetch("/api/game/" + (!pin ? "create" : "join"), {
method: "POST", method: "POST",
body: JSON.stringify({ ...token, pin: pin }), body: JSON.stringify({ token, pin }),
}) })
.then(successfulResponse) .then(successfulResponse)
.then((game) => createSchema.parse(game)) .then((game) => createSchema.parse(game))
}) )
const res = await toast.promise(gamePromise, { const res = await toast.promise(gamePromise, {
pending: { pending: {
@ -103,7 +102,7 @@ export default function Home({ q }: Props) {
return return
} }
gameFetch(otp) gameFetch(otp)
}, [otp]) }, [otp, gameFetch])
return ( return (
<div className="h-full bg-theme"> <div className="h-full bg-theme">