X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FMyGames.vue;h=953c976eb9e1f0a89f68961a664da77815816f7d;hb=2a8a94c9e539319c76c0a72967b39f2e7e7b279e;hp=5d8620736b380eb1f00b3893289ab27baf95e84f;hpb=cafe016679ee9c14bf7bf0a37104ade7f74aff89;p=vchess.git diff --git a/client/src/views/MyGames.vue b/client/src/views/MyGames.vue index 5d862073..953c976e 100644 --- a/client/src/views/MyGames.vue +++ b/client/src/views/MyGames.vue @@ -141,11 +141,17 @@ export default { { vname: vname, type: type, - score: "*" + score: "*", + turn: "w" }, gameInfo ); - this[type + "Games"].push(game); + // TODO: the new game isn't sorted. Maybe apply a different strategy: + // 1) Sort all at loading, + // 2) Insert in place when new games arrive, + // 3) Change position when score or turn change. + // And GameList just show list unsorted. + this[type + "Games"].unshift(game); this.tryShowNewsIndicator(type); break; } @@ -165,6 +171,7 @@ export default { g.players[0].sid == this.st.user.sid ? "w" : "b"; + if (!!g.turn) return g.turn == myColor; const rem = g.movesCount % 2; return ( (rem == 0 && myColor == "w") ||