Little fix
This commit is contained in:
parent
549d0f1d77
commit
b9e72b2a32
1 changed files with 5 additions and 6 deletions
|
@ -48,15 +48,14 @@ export default function Home({ q }: Props) {
|
|||
})
|
||||
.optional(),
|
||||
})
|
||||
const gamePromise = getAccessToken().then((token) => {
|
||||
console.log(otp, { ...token, pin })
|
||||
return fetch("/api/game/" + (!pin ? "create" : "join"), {
|
||||
const gamePromise = getAccessToken().then((token) =>
|
||||
fetch("/api/game/" + (!pin ? "create" : "join"), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ ...token, pin: pin }),
|
||||
body: JSON.stringify({ token, pin }),
|
||||
})
|
||||
.then(successfulResponse)
|
||||
.then((game) => createSchema.parse(game))
|
||||
})
|
||||
)
|
||||
|
||||
const res = await toast.promise(gamePromise, {
|
||||
pending: {
|
||||
|
@ -103,7 +102,7 @@ export default function Home({ q }: Props) {
|
|||
return
|
||||
}
|
||||
gameFetch(otp)
|
||||
}, [otp])
|
||||
}, [otp, gameFetch])
|
||||
|
||||
return (
|
||||
<div className="h-full bg-theme">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue