Fixed an undefined in better

This commit is contained in:
Tracker-Friendly 2025-03-24 20:20:01 +00:00
parent 1a1cd96b04
commit 08aeae8335

View file

@ -35,15 +35,16 @@
async function getBet() {
let response = await fetch("/api/getCurrentBet");
if (response.ok) {
let data = await response.json();
let data = await response.json();
if (response.ok || data.error != null) {
document.getElementById("question").innerText = data.question;
outcomes = data.possible;
document.getElementById("possible").innerText = "Possible outcomes: " + outcomes.join(", ");
// noinspection ES6MissingAwait
updateTimer(data.timeToBet);
} else {
document.getElementById("question").innerText = "No bet is currently active";
alert("There are no bets currently open");
window.location.href = "/";
}
}