Fixed broken betting

This commit is contained in:
Tracker-Friendly 2025-03-24 21:21:52 +00:00
parent 5cbb637890
commit 6282648ab6
2 changed files with 2 additions and 1 deletions

View file

@ -38,7 +38,7 @@
let response = await fetch("/api/endBet", {
method: "POST",
body: JSON.stringify({
"correct": possible.index(prompt("What was the correct answer?"))
"correct": possible.indexOf(prompt("What was the correct answer?"))
})
})
if (response.ok) {

View file

@ -40,6 +40,7 @@
document.getElementById("question").innerText = data.question;
outcomes = data.possible;
document.getElementById("possible").innerText = "Possible outcomes: " + outcomes.join(", ");
document.getElementById("bet").disabled = false;
// noinspection ES6MissingAwait
updateTimer(data.timeToBet);
} else {