X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=cb1b720d540e587b378313932c8fe8d1b1ed4029;hb=bf7e5f3669a4c0bfa2756921d15d3fd055d4cfd2;hp=6282680845cbea3d84e98d8a653e855ac797b4eb;hpb=42a9284896b9cf9a579d32b7cf77dfc1f5786472;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 62826808..cb1b720d 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -938,14 +938,9 @@ export default { if (game.score == "*") { // Set clocks + initime game.initime = [0, 0]; - if (L >= 1) { - const gameLastupdate = game.moves[L-1].played; - game.initime[L % 2] = gameLastupdate; - if (L >= 2) { - game.clocks[L % 2] = - tc.mainTime - (Date.now() - gameLastupdate) / 1000; - } - } + if (L >= 1) game.initime[L % 2] = game.moves[L-1].played; + // NOTE: game.clocks shouldn't be computed right now: + // job will be done in re_setClocks() called soon below. } // Sort chat messages from newest to oldest game.chats.sort((c1, c2) => { @@ -1041,11 +1036,8 @@ export default { }, game, ); - if (this.gameIsLoading) - // Re-load game because we missed some moves: - // artificially reset BaseGame (required if moves arrived in wrong order) - this.$refs["basegame"].re_setVariables(); - else { + this.$refs["basegame"].re_setVariables(this.game); + if (!this.gameIsLoading) { // Initial loading: this.gotMoveIdx = game.moves.length - 1; // If we arrive here after 'nextGame' action, the board might be hidden