Fixed an undefined in better
This commit is contained in:
parent
1a1cd96b04
commit
08aeae8335
1 changed files with 4 additions and 3 deletions
|
@ -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 = "/";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue