From: Benjamin Auder Date: Sun, 31 May 2020 20:52:44 +0000 (+0200) Subject: Prepare cadence recognition for simultaneous games X-Git-Url: https://git.auder.net/variants/%24%7Bvname%7D/doc/index.css?a=commitdiff_plain;h=bf588c57bdac8525f57c2017b6e70e9390e06700;p=vchess.git Prepare cadence recognition for simultaneous games --- diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index cd781a5d..fa7ab3b2 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -522,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) { diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 4e1e54b8..547237fb 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -562,9 +562,12 @@ export default { }, // o: challenge or game classifyObject: function(o) { - // Consider imports as live games (TODO) - if (!!o.id && !!o.id.toString().match(/^i/)) return "live"; - return o.cadence.indexOf("d") === -1 ? "live" : "corr"; + // No imported games here + return ( + game.cadence.indexOf("d") >= 0 + ? "corr" + : (game.cadence.indexOf("/") >= 0 ? "simul" : "live") + ); }, setDisplay: function(letter, type, e) { this[letter + "display"] = type;