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(),
|
.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">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue