- let minCreated = Number.MAX_SAFE_INTEGER
- let maxCreated = 0
- let augmentedGames = this.games.map(g => {
- let priority = 0;
- if (g.players.some(p => p.uid == this.st.user.id || p.sid == this.st.user.sid))
- {
- priority++;
- if (g.score == "*")
- {
+ let minCreated = Number.MAX_SAFE_INTEGER;
+ let maxCreated = 0;
+ 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
+ )
+ ) {