X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=89bef8da549e1724226576333380079bbe31dba2;hb=11667c79617c057357f2a176c798bfee3b190771;hp=2d5838d4ccf3819cf531ce105c67382ac0921833;hpb=6d68309ae2aa62cac650967d18cd7f397e70532e;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 2d5838d4..89bef8da 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -419,9 +419,7 @@ export default { else { // Local or corr game - GameStorage.get(this.gameRef.id, (game) => { - afterRetrieval(game); - }); + GameStorage.get(this.gameRef.id, afterRetrieval); } }, // Post-process a move (which was just played) @@ -451,11 +449,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