X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FMyGames.vue;h=d12fff480f845d1e031cc98926e24b89da124ce7;hp=3d86636ff3603c9e143eb19a5ee699123a1a2242;hb=bae751bc6bc548791772c3ff5883a03deeb77264;hpb=eaa5ad3e93b761fefb16b32071be0b439761f843 diff --git a/client/src/views/MyGames.vue b/client/src/views/MyGames.vue index 3d86636f..d12fff48 100644 --- a/client/src/views/MyGames.vue +++ b/client/src/views/MyGames.vue @@ -88,7 +88,7 @@ export default { // st.variants changes only once, at loading from [] to [...] "st.variants": function() { // Set potential games variant names + display: - this.livesGames.concat(this.corrGames).concat(this.importGames) + this.liveGames.concat(this.corrGames).concat(this.importGames) .forEach(o => { if (!o.vname) this.setVname(o); }); @@ -157,6 +157,7 @@ export default { this.corrGames.forEach(g => { g.type = "corr"; g.score = "*"; + g.options = JSON.parse(g.options); }); this.decorate(this.corrGames); // Now ask completed games (partial list) @@ -279,6 +280,8 @@ export default { case "notifynewgame": { let gameInfo = data.data; this.setVname(gameInfo); + // TODO: remove patch on next line (options || "{}") + gameInfo.options = JSON.parse(gameInfo.options || "{}"); const type = (gameInfo.cadence.indexOf('d') >= 0 ? "corr": "live"); let game = Object.assign( { @@ -368,7 +371,10 @@ export default { if (L > 0) { this.cursor["corr"] = res.games[L - 1].created; let moreGames = res.games; - moreGames.forEach(g => g.type = "corr"); + moreGames.forEach(g => { + g.type = "corr"; + g.options = JSON.parse(g.options); + }); this.decorate(moreGames); this.corrGames = this.corrGames.concat(moreGames); } @@ -384,7 +390,11 @@ export default { if (L > 0) { // Add "-1" because IDBKeyRange.upperBound includes boundary this.cursor["live"] = localGames[L - 1].created - 1; - localGames.forEach(g => g.type = "live"); + localGames.forEach(g => { + g.type = "live"; + // TODO: remove patch on next line (options || "{}") + g.options = JSON.parse(g.options || "{}"); + }); this.decorate(localGames); this.liveGames = this.liveGames.concat(localGames); } @@ -400,6 +410,8 @@ export default { this.cursor["import"] = importGames[L - 1].created - 1; importGames.forEach(g => { g.type = "import"; + // TODO: remove following patch (options || "{}") + g.options = JSON.parse(g.options || "{}"); this.setVname(g); }); this.importGames = this.importGames.concat(importGames);