From 0bb8b3dbe03e552161fc321923f288e23648197b Mon Sep 17 00:00:00 2001 From: Anteneh Denbel <112484153+Antenehden@users.noreply.github.com> Date: Sun, 11 Aug 2024 19:15:42 -0500 Subject: [PATCH] Update index.html to display winner --- html/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/html/index.html b/html/index.html index a31e739..62d3c0c 100644 --- a/html/index.html +++ b/html/index.html @@ -270,9 +270,14 @@

Scores

stakeDisplay.textContent = 'Stake: ' + (currentRound.currentStake); statusDisplay.textContent = 'Status: ' + (gameState.isGameActive ? 'Closed' : 'Open'); roundDisplay.textContent = 'Round: ' + (gameState.currentRoundIndex + 1) + '/' + gameState.rounds.length; - winnerDisplay.textContent = 'Winner: ' + (gameState.winner ? gameState.winner.name : 'No winner yet'); currentPlayerDisplay.textContent = 'Current Player: ' + (gameState.players.find(p => p.name === currentPlayer.name).name); + if (!gameState.isGameActive && gameState.stats.winner) { + winnerDisplay.textContent = 'Winner: ' + gameState.stats.winner.name; + } else { + winnerDisplay.textContent = 'Winner: '; + } + scoreTable.innerHTML = ''; gameState.players.forEach(player => { const row = document.createElement('tr');