X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=ab8605727efef0b288095b2b55d4f210d12ee584;hb=cd4cad0468612cf00c6e6879554e3cee58d4b1f9;hp=7af9c8e32976295cfc442fa863b7c89381ee81e8;hpb=ecf44502c1ed7c408b8ea4d1be5234203aa3d314;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 7af9c8e3..ab860572 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -538,7 +538,7 @@ Vue.component('my-game', { if (!continuation) { // Not playing sound on game continuation: - new Audio("/sounds/newgame.mp3").play().catch(err => {}); + new Audio("/sounds/newgame.mp3").play().then(() => {}).catch(err => {}); document.getElementById("modal-newgame").checked = false; } this.oppid = oppId; @@ -549,7 +549,7 @@ Vue.component('my-game', { { const oppCol = this.vr.turn; const lastMove = moves[moves.length-1]; - this.vr.undo(lastMove, "ingame"); + this.vr.undo(lastMove); this.incheck = this.vr.getCheckSquares(lastMove, oppCol); this.vr.play(lastMove, "ingame"); } @@ -685,7 +685,7 @@ Vue.component('my-game', { // Not programmatic, or animation is over if (this.mode == "human" && this.vr.turn == this.mycolor) this.conn.send(JSON.stringify({code:"newmove", move:move, oppid:this.oppid})); - new Audio("/sounds/chessmove1.mp3").play().catch(err => {}); + new Audio("/sounds/chessmove1.mp3").play().then(() => {}).catch(err => {}); this.vr.play(move, "ingame"); if (this.mode == "human") this.updateStorage(); //after our moves and opponent moves