X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=4d44cd1acfb295efca43f53a48496153667ceac0;hp=2d5838d4ccf3819cf531ce105c67382ac0921833;hb=a4480041556612060da8ba4cf30adc48895d746e;hpb=6d68309ae2aa62cac650967d18cd7f397e70532e diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 2d5838d4..4d44cd1a 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -451,11 +451,21 @@ export default { let sendMove = Object.assign({}, filtered_move, {addTime: addTime}); if (this.game.type == "corr") sendMove.message = this.corrMsg; - this.st.conn.send(JSON.stringify({ - code: "newmove", - target: this.getOppSid(), - move: sendMove, - })); + const oppsid = this.getOppSid(); + if (!!oppsid) + { + this.st.conn.send(JSON.stringify({ + code: "newmove", + target: oppsid, + move: sendMove, + })); + } + if (this.game.type == "corr" && this.corrMsg != "") + { + // Add message to last move in BaseGame: + // TODO: not very good style... + this.$refs["basegame"].setCurrentMessage(this.corrMsg); + } } else addTime = move.addTime; //supposed transmitted