From: Benjamin Auder Date: Tue, 10 Mar 2020 00:36:09 +0000 (+0100) Subject: Do not show deleted games in GameList X-Git-Url: https://git.auder.net/img/css/current/gitweb.js?a=commitdiff_plain;h=b265313e42e5aa48fe86b2a1c66241bde4deb4fb;p=vchess.git Do not show deleted games in GameList --- diff --git a/client/src/components/GameList.vue b/client/src/components/GameList.vue index 71602028..5396d13c 100644 --- a/client/src/components/GameList.vue +++ b/client/src/components/GameList.vue @@ -57,12 +57,13 @@ export default { // Show in order: it's my turn, running games, completed games let minCreated = Number.MAX_SAFE_INTEGER; let maxCreated = 0; - this.games.forEach(g => { + let remGames = this.games.filter(g => !this.deleted[g.id]); + remGames.forEach(g => { if (g.created < minCreated) minCreated = g.created; if (g.created > maxCreated) maxCreated = g.created; }); const deltaCreated = maxCreated - minCreated; - return this.games.sort((g1, g2) => { + return remGames.sort((g1, g2) => { return ( g2.priority - g1.priority + (g2.created - g1.created) / deltaCreated );