]> git.seodisparate.com - RockPaperScissorsDuel/commitdiff
Attempt to fix first-load bug (again)
authorStephen Seo <seo.disparate@gmail.com>
Wed, 18 Jan 2023 06:57:53 +0000 (15:57 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 18 Jan 2023 06:57:53 +0000 (15:57 +0900)
wasm_build/client.js

index 51a74f64ebd2672955c351baf67d13b83adbd53d..51828433c0ea47943e97436ff1803d559d17b896 100644 (file)
@@ -1,3 +1,5 @@
+// Use setTimeout to give the .wasm binary to load first.
+setTimeout(() => {
 Rune.initClient({
     visualUpdate: ({ newGame, yourPlayerId}) => {
         const { player1, player2, first_choices, second_choices, ready, matchup_done, pos, prev_pos, gameover, gameover_called, matchup_started } = newGame;
@@ -54,3 +56,4 @@ Rune.initClient({
         }
     },
 });
+}, 500);