X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=1071ece83f0f9fce229bcddd8801fb5ece0e5573;hp=ac0a41ec946df54e4dfbdb577a6db2fff0e02799;hb=bae751bc6bc548791772c3ff5883a03deeb77264;hpb=8899888e08a54dd3014693bc239f4cec7ddc26d7 diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index ac0a41ec..1071ece8 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -374,7 +374,7 @@ export default { id: my.id, name: my.name, tmpIds: { - tmpId: { focus: true } + [tmpId]: { focus: true } } } ); @@ -1066,7 +1066,7 @@ export default { let gameInfo = { id: getRandString(), //ignored if corr fen: V.GenRandInitFen(this.game.options), - options: this.game.options, + options: JSON.stringify(this.game.options), players: [this.game.players[1], this.game.players[0]], vid: this.game.vid, cadence: this.game.cadence @@ -1099,11 +1099,7 @@ export default { "/games", "POST", { - data: Object.assign( - {}, - gameInfo, - { options: JSON.stringify(this.game.options) } - ), + data: { gameInfo: gameInfo }, success: (response) => { gameInfo.id = response.id; notifyNewGame(); @@ -1320,7 +1316,9 @@ export default { const trySetVname = setInterval( () => { // this.st.variants might be uninitialized (variant == null) - variant = this.st.variants.find(v => v.id == game.vid); + variant = this.st.variants.find(v => { + return v.id == game.vid || v.name == game.vname + }); if (!!variant) { clearInterval(trySetVname); game.vname = variant.name; @@ -1620,7 +1618,9 @@ export default { if (["all","byrow"].includes(V.ShowMoves)) { this.curDiag = getDiagram({ position: position, - orientation: V.CanFlip ? this.game.mycolor : "w" + orientation: V.CanFlip ? this.game.mycolor : "w", + color: this.game.mycolor, + score: "*" }); document.querySelector("#confirmDiv > .card").style.width = boardDiv.offsetWidth + "px";