make lobby game post refresh page better

This commit is contained in:
ajuvercr 2020-04-10 19:10:28 +02:00
parent 6b7fd4eff3
commit e3bb2f5d8c

View file

@ -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();