From 7895648209b4f7c53413f6bf6c74549b06882b00 Mon Sep 17 00:00:00 2001 From: Cay Date: Thu, 12 Mar 2026 11:01:25 +0000 Subject: [PATCH] tzuo --- public/js/chat.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/js/chat.js b/public/js/chat.js index cd1ae2c..32c0bb7 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -1,5 +1,10 @@ const socket = io(); -socket.emit("register", window.playerName?.name || window.playerName); +const username = + typeof window.playerName === "object" + ? window.playerName.name + : window.playerName; + +socket.emit("register", username); const chatTitle = document.getElementById("chat-title"); let channel = "global";