Fix moves highlight in moves list for Apocalypse and Synchrone
authorBenjamin Auder <benjamin.auder@somewhere>
Mon, 30 Mar 2020 21:40:46 +0000 (23:40 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Mon, 30 Mar 2020 21:40:46 +0000 (23:40 +0200)
client/src/components/MoveList.vue

index 4c351dd..a9fa983 100644 (file)
@@ -138,7 +138,14 @@ export default {
     highlightBlackmove: function(moveIdx) {
       return (
         this.cursor == moveIdx ||
-        (this.show == "byrow" && this.cursor == moveIdx + 1)
+        (
+          // If display by rows, hightlight last black move while the white
+          // move is being played:
+          this.show == "byrow" &&
+          this.cursor == moveIdx + 1 &&
+          // ...except if cursor is behind in the game:
+          this.cursor == this.moves.length - 1
+        )
       );
     },
     gotoMove: function(index) {