- serverGames.forEach(g => g.type = "corr");
- this.decorate(serverGames);
- this.corrGames = serverGames;
- adjustAndSetDisplay();
+ this.decorate(this.corrGames);
+ // Now ask completed games (partial list)
+ ajax(
+ "/completedgames",
+ "GET",
+ {
+ credentials: true,
+ data: { cursor: this.cursor },
+ success: (res2) => {
+ const L = res2.games.length;
+ if (L > 0) {
+ this.cursor = res2.games[L - 1].created;
+ let completedGames = res2.games;
+ completedGames.forEach(g => g.type = "corr");
+ this.decorate(completedGames);
+ this.corrGames = this.corrGames.concat(completedGames);
+ adjustAndSetDisplay();
+ }
+ }
+ }
+ );