kick confirmation with translation key

This commit is contained in:
Restart2008
2025-12-25 09:53:00 -08:00
parent cf0e53c412
commit 83eb1e04dc
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -694,7 +694,8 @@
"send_troops": "Send Troops",
"send_gold": "Send Gold",
"emotes": "Emojis",
"kick": "Kick Player"
"kick": "Kick Player",
"kick_confirm": "Are you sure you want to kick {name}?"
},
"send_troops_modal": {
"title_with_name": "Send Troops to {name}",
@@ -278,6 +278,13 @@ export class PlayerPanel extends LitElement implements Layer {
private handleKickClick(e: Event, other: PlayerView) {
e.stopPropagation();
if (
!window.confirm(
translateText("player_panel.kick_confirm", { name: other.name() }),
)
) {
return;
}
const targetClientID = other.clientID();
if (!targetClientID) {
console.warn("Cannot kick player without clientID");