From 11d5ca7c7c9a9152fa8fa9c8e4e65c504c5bd162 Mon Sep 17 00:00:00 2001 From: Allan Cueff Date: Thu, 9 Nov 2023 22:54:56 +0100 Subject: [PATCH] fix no team next match --- Front/js/backend/team.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Front/js/backend/team.js b/Front/js/backend/team.js index ffec09d..c9ae1ce 100644 --- a/Front/js/backend/team.js +++ b/Front/js/backend/team.js @@ -141,8 +141,11 @@ function getPromoCard(promo, teamsBySport){ const nextMatch = MatchList.find(match => match.team1 && match.team2 && match.status === "waiting" && (match.expand.team1.promo === promo.id || match.expand.team2.promo === promo.id)); if(nextMatch){ const time_start = new Date(nextMatch.heure_debut); - cardHtml += `` - } + if(nextMatch.team1 && nextMatch.team2){ + cardHtml += `` + } else { + cardHtml += `` + } } cardHtml += `` return cardHtml } @@ -187,7 +190,11 @@ function getTeamCard(teamBySport){ const nextMatch = MatchList.find(match => match.team1 && match.team2 && match.status === "waiting" && (match.expand.team1.name === equipe.name || match.expand.team2.name === equipe.name)); if(nextMatch){ const time_start = new Date(nextMatch.heure_debut); - cardHtml += `` + if(nextMatch.team1 && nextMatch.team2){ + cardHtml += `` + } else { + cardHtml += `` + } } cardHtml += `` return cardHtml