X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FComputerGame.vue;h=52cfc5e2e0d3d55f63743ed03f1aebff59819fa4;hb=7b3cf1b79954a47000527dd0c3f0fc1cecb5315d;hp=1506e9828aadc39bc6d6bd1412a45f3ca5878cfb;hpb=7aa548e72ba8a4af4e2c7f63e7723ad10d2cd3a4;p=vchess.git 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"