From 44aceae2fa303ad06c3417bbe6dad91743aef827 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Jakse?= Date: Sat, 6 Dec 2025 16:06:53 +0100 Subject: [PATCH] Reset the chat history when resetting the game Suggested by a user. --- l10n/po/fr/trivabble.po | 4 ++-- l10n/pot/trivabble.pot | 2 +- public/trivabble.js | 3 ++- server/trivabble-server.js | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/l10n/po/fr/trivabble.po b/l10n/po/fr/trivabble.po index 4306a19..5cfc7cc 100644 --- a/l10n/po/fr/trivabble.po +++ b/l10n/po/fr/trivabble.po @@ -28,8 +28,8 @@ msgstr "Pour changer de nom, saisissez-en un nouveau. Vous pouvez continuer à u msgid "You cannot take another tile: your rack is full." msgstr "Vous ne pouvez pas tirer de pièce : votre chevalet est complet." -msgid "Are you sure you want to put all the tiles back in the bag (in order to play another game)?" -msgstr "Êtes-vous sûr·e de vouloir remettre toutes les lettres du jeu dans le sac (en vue de jouer une nouvelle partie) ?" +msgid "Are you sure you want to put all the tiles back in the bag (in order to play another game)? This will also clear the chat history." +msgstr "Êtes-vous sûr·e de vouloir remettre toutes les lettres du jeu dans le sac (en vue de jouer une nouvelle partie) ? Cela remettra également l'historique du chat à zéro." msgid "Are you sure you want to put all your tiles back in the bag?" msgstr "Êtes-vous sûr·e de vouloir remettre toutes vos lettres dans le sac ?" diff --git a/l10n/pot/trivabble.pot b/l10n/pot/trivabble.pot index 98d1812..2cb91f9 100644 --- a/l10n/pot/trivabble.pot +++ b/l10n/pot/trivabble.pot @@ -30,7 +30,7 @@ msgstr "" msgid "You cannot take another tile: your rack is full." msgstr "" -msgid "Are you sure you want to put all the tiles back in the bag (in order to play another game)?" +msgid "Are you sure you want to put all the tiles back in the bag (in order to play another game)? This will also clear the chat history." msgstr "" msgid "Are you sure you want to put all your tiles back in the bag?" diff --git a/public/trivabble.js b/public/trivabble.js index ae16d62..bc99c95 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -1200,6 +1200,7 @@ lastPlayer = null; currentTileOwner = {}; + chatMessages.textContent = ""; break; case "moveLetter": @@ -1820,7 +1821,7 @@ function clearGame() { myConfirm( - _("Are you sure you want to put all the tiles back in the bag (in order to play another game)?"), + _("Are you sure you want to put all the tiles back in the bag (in order to play another game)? This will also clear the chat history."), function () { sendCmds([{cmd: "resetGame"}]); } diff --git a/server/trivabble-server.js b/server/trivabble-server.js index ec1abae..3216cbf 100644 --- a/server/trivabble-server.js +++ b/server/trivabble-server.js @@ -498,7 +498,7 @@ Game.prototype.bagPushLetter = function (letter, player) { }; Game.prototype.reset = function (player) { - this.init(this.lang, this.label, this.factor, this.checkFirstWord, this.freezePlayedTiles, this.chatHistory); + this.init(this.lang, this.label, this.factor, this.checkFirstWord, this.freezePlayedTiles, []); this.pendingEvents.push({ player: player, action: "reset", -- 2.30.2