diff --git a/cmd/server/internal/public/index.html b/cmd/server/internal/public/index.html index c797860..494035e 100644 --- a/cmd/server/internal/public/index.html +++ b/cmd/server/internal/public/index.html @@ -23,8 +23,10 @@ function pollState() { http("GET", "/api/v1/questions", (body) => { + if (!body) + return; g_questions = JSON.parse(body); - console.log("polled state:", body); + console.log("TODO polled state:", body); pollLiveAnswer(); pollLiveQuestion(); }); @@ -35,12 +37,28 @@ if (live_questions) { g_live_question = live_questions[0]; } + if (g_live_question) { + document.getElementById("question-text").innerHTML = g_live_question.Text; + let options = ""; + for (let i of g_live_question.Options) + options += `