From b265313e42e5aa48fe86b2a1c66241bde4deb4fb Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Tue, 10 Mar 2020 01:36:09 +0100
Subject: [PATCH] Do not show deleted games in GameList

---
 client/src/components/GameList.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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
         );
-- 
2.44.0