From bf588c57bdac8525f57c2017b6e70e9390e06700 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Sun, 31 May 2020 22:52:44 +0200 Subject: [PATCH] Prepare cadence recognition for simultaneous games --- client/src/views/Game.vue | 6 +++++- client/src/views/Hall.vue | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) 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; -- 2.44.0