diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-03-30 17:26:06 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-04-03 13:38:29 +0200 |
commit | 01f16c46c1001bb77041d45c4f5eec10d9470b4a (patch) | |
tree | 78dac7f93236313d3e4b5697a5928d68924ec118 /public | |
parent | aa5bbfd04e85ea8a0c63fe9b8bd220a1898f70a7 (diff) | |
download | server-01f16c46c1001bb77041d45c4f5eec10d9470b4a.tar.gz |
Fix race condition when connecting before game specific code is loaded.
Diffstat (limited to 'public')
-rw-r--r-- | public/common/play.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/public/common/play.js b/public/common/play.js index 13ce453..b91e4a0 100644 --- a/public/common/play.js +++ b/public/common/play.js @@ -845,7 +845,9 @@ async function init_replay() { } } -if (params.mode === "replay") - init_replay(); -if (params.mode === "play") - connect_play(); +window.addEventListener("load", function () { + if (params.mode === "replay") + init_replay(); + if (params.mode === "play") + connect_play(); +}); |