Fix mode in PGN
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 20 Nov 2018 01:59:03 +0000 (02:59 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 20 Nov 2018 01:59:03 +0000 (02:59 +0100)
public/javascripts/components/game.js

index 8e8e277..96833bc 100644 (file)
@@ -616,6 +616,7 @@ Vue.component('my-game', {
                                this.oppConnected = true;
                                this.mycolor = color;
                                this.seek = false;
+                               this.mode = "human";
                                if (!!moves && moves.length > 0) //imply continuation
                                {
                                        const lastMove = moves[moves.length-1];
@@ -628,6 +629,7 @@ Vue.component('my-game', {
                        }
                        else //against computer
                        {
+                               this.mode = "computer";
                                this.mycolor = Math.random() < 0.5 ? 'w' : 'b';
                                if (this.mycolor == 'b')
                                        setTimeout(this.playComputerMove, 500);