diff --git a/backend/static/script/lobby.js b/backend/static/script/lobby.js index 320fb64..0771ddf 100644 --- a/backend/static/script/lobby.js +++ b/backend/static/script/lobby.js @@ -36,12 +36,9 @@ async function start_game() { }; xhr.open("POST", "/lobby"); - xhr.send(JSON.stringify(obj)); + xhr.addEventListener("loadend", refresh_state); - setTimeout( - () => refresh_state(), - 200 - ); + xhr.send(JSON.stringify(obj)); } -window.onload = () => refresh_state(); +window.onload = () => refresh_state(); \ No newline at end of file