X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FComputerGame.vue;h=52cfc5e2e0d3d55f63743ed03f1aebff59819fa4;hp=1506e9828aadc39bc6d6bd1412a45f3ca5878cfb;hb=7b3cf1b79954a47000527dd0c3f0fc1cecb5315d;hpb=06e79b0783d6e9962ca6b2a25f62d46f46fa5c8b diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index 1506e982..52cfc5e2 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -48,7 +48,11 @@ export default { this.compWorker.onmessage = e => { let compMove = e.data; if (!compMove) + { + this.compThink = false; + this.$emit("game-stopped"); //no more moves: mate or stalemate return; //after game ends, no more moves, nothing to do + } if (!Array.isArray(compMove)) compMove = [compMove]; //to deal with MarseilleRules // Small delay for the bot to appear "more human"