},
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) {
// - 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",