diff --git a/islands/Chat.tsx b/islands/Chat.tsx index 3723016..3e01c7f 100644 --- a/islands/Chat.tsx +++ b/islands/Chat.tsx @@ -17,10 +17,12 @@ export default function Chat() { useEffect(() => { if (!username) { const randomNum = Math.floor(Math.random() * 10000); - setUsername(`User${randomNum}`); + setUsername(`HumanGuest${randomNum}`); } - const wsProtocol = window.location.protocol === "https:" ? "wss:" : "ws:"; + const wsProtocol = globalThis.location.protocol === "https:" + ? "wss:" + : "ws:"; const ws = new WebSocket( `${wsProtocol}//${globalThis.location.host}/api/chat`, ); @@ -77,7 +79,7 @@ export default function Chat() { }; return ( -
- You are chatting as{" "} + You are connected as{" "} {username}
This is an ephemeral chat room. Messages are only visible to users currently online and aren't stored after you leave.