- const gidx = this.games.findIndex(g => g.id == gid);
- if (gidx >= 0) {
- const game = this.games[gidx];
- if (
- game.type == "live" &&
- game.rids.length == 1 &&
- game.rids[0] == data.from
- ) {
- this.games.splice(gidx, 1);
+ // Corr games are always reachable:
+ if (!gid.match(/^[0-9]+$/)) {
+ const gidx = this.games.findIndex(g => g.id == gid);
+ // NOTE: gidx should always be >= 0 (TODO?)
+ if (gidx >= 0) {
+ const game = this.games[gidx];
+ ArrayFun.remove(game.rids, rid => rid == data.from);
+ if (game.rids.length == 0) this.games.splice(gidx, 1);