- let augmentedGames = this.games.map(g => {
- let priority = 0;
- let myColor = undefined;
- if (
- g.players.some(
- p => p.uid == this.st.user.id || p.sid == this.st.user.sid
- )
- ) {
- priority++;
- myColor =
- g.players[0].uid == this.st.user.id ||
- g.players[0].sid == this.st.user.sid
- ? "w"
- : "b";
- if (g.score == "*") {
+ const isMyTurn = (g, myColor) => {
+ const rem = g.movesCount % 2;
+ return (
+ (rem == 0 && myColor == "w") ||
+ (rem == 1 && myColor == "b")
+ );
+ };
+ let augmentedGames = this.games
+ .filter(g => !this.deleted[g.id])
+ .map(g => {
+ let priority = 0;
+ let myColor = undefined;
+ if (
+ g.players.some(
+ p => p.uid == this.st.user.id || p.sid == this.st.user.sid
+ )
+ ) {