X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=fa7ab3b29f67d7e9ef498e9c5cf5545b7ba52612;hb=f96bffd41095efe02b6eec82ecddb7debb192bfa;hp=4afac12da6ecedbe3dfdab87e6630ec7275d3ff7;hpb=58aedcd1f49272a6f0dfb7adeeb7650d7daeb75e;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 4afac12d..fa7ab3b2 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -213,6 +213,7 @@ export default { game: {}, //passed to BaseGame focus: !document.hidden, //will not always work... TODO // virtualClocks will be initialized from true game.clocks + // TODO: clock update triggers re-rendering. Should be out of Vue virtualClocks: [], vr: null, //"variant rules" object initialized from FEN rulesContent: "", @@ -521,7 +522,11 @@ export default { }, getGameType: function(game) { if (!!game.id.toString().match(/^i/)) return "import"; - return game.cadence.indexOf("d") >= 0 ? "corr" : "live"; + return ( + game.cadence.indexOf("d") >= 0 + ? "corr" + : (game.cadence.indexOf("/") >= 0 ? "simul" : "live") + ); }, // Notify something after a new move (to opponent and me on MyGames page) notifyMyGames: function(thing, data) { @@ -1284,7 +1289,10 @@ console.log(data.data); // - from server (one correspondance game I play[ed] or not) // - from remote peer (one live game I don't play, finished or not) fetchGame: function(callback) { - if (Number.isInteger(this.gameRef) || !isNaN(parseInt(this.gameRef))) { + if ( + Number.isInteger(this.gameRef) || + !isNaN(parseInt(this.gameRef, 10)) + ) { // corr games identifiers are integers ajax( "/games",