From: Benjamin Auder <benjamin.auder@somewhere>
Date: Fri, 3 Apr 2020 22:16:47 +0000 (+0200)
Subject: Fix double-move sending in corr games
X-Git-Url: https://git.auder.net/doc/%7B%7B%20asset%28%27mixstore/current/img/common.css?a=commitdiff_plain;h=12d38d0f53f4ab534e44467550b72705858810d4;p=vchess.git

Fix double-move sending in corr games
---

diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index 8b5ca8b6..398a0a27 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -1451,9 +1451,12 @@ export default {
           }
         );
         // PlayOnBoard is enough, and more appropriate for Synchrone Chess
-        V.PlayOnBoard(this.vr.board, move);
+        const arMove = (Array.isArray(move) ? move : [move]);
+        for (let i = 0; i < arMove.length; i++)
+          V.PlayOnBoard(this.vr.board, arMove[i]);
         const position = this.vr.getBaseFen();
-        V.UndoOnBoard(this.vr.board, move);
+        for (let i = arMove.length - 1; i >= 0; i--)
+          V.UndoOnBoard(this.vr.board, arMove[i]);
         if (["all","byrow"].includes(V.ShowMoves)) {
           this.curDiag = getDiagram({
             position: position,