From d6e4acdf4ec91e5c5f83248d9712dfa6d9371f2f Mon Sep 17 00:00:00 2001 From: ur002 Date: Sun, 1 Feb 2026 19:14:07 +0300 Subject: [PATCH] feat(chat): add function to clear game chat before starting a new game and on exit --- poker.db | Bin 53248 -> 53248 bytes public/main.js | 14 ++++++++++++++ 2 files changed, 14 insertions(+) diff --git a/poker.db b/poker.db index 895f32019fa5cfce2f65735cef4951744c2e346c..31a3e37bf3908edcf838c2b50959a913de90fae0 100644 GIT binary patch delta 96 zcmZozz}&Ead4e>f+C&*=MzxIzGv(RMtPG8vy6*#6afgLpfHF86S@EZ diff --git a/public/main.js b/public/main.js index 79a2989..465e4fe 100644 --- a/public/main.js +++ b/public/main.js @@ -194,6 +194,9 @@ function startSinglePlayer() { // Сохраняем имя localStorage.setItem('playerName', playerName); + // Очищаем чат перед началом новой игры + clearGameChat(); + // Создаём игру game = new PokerGame({ smallBlind: 5, @@ -1502,6 +1505,16 @@ function toggleChat() { document.getElementById('game-chat').classList.toggle('expanded'); } +/** + * Очистить игровой чат + */ +function clearGameChat() { + const container = document.getElementById('game-chat-messages'); + if (container) { + container.innerHTML = ''; + } +} + // ============================================================================= // НАСТРОЙКИ // ============================================================================= @@ -1966,6 +1979,7 @@ function leaveGame() { leaveRoom(); } game = null; + clearGameChat(); // Очищаем чат при выходе из игры showScreen('main-menu'); } }