diff --git a/client-src/routes/index.tsx b/client-src/routes/index.tsx index e653e5c..a397afa 100644 --- a/client-src/routes/index.tsx +++ b/client-src/routes/index.tsx @@ -6,6 +6,7 @@ import { FromServerSocketMessage, Hat, SVGUploaded, + DEFAULT_NAME, } from "../../isomophic-src/isomorphic"; import UserMessage from "../views/room/UserMessage"; import { HAT_MAP } from "../views/room/state/hats"; @@ -25,7 +26,7 @@ function Index() { ); const [hat, setHat] = useState("/TopHatP.png"); const [frog, setFrog] = useState("/Frog1AP.png"); - const [name, setName] = useState("frogboi"); + const [name, setName] = useState(DEFAULT_NAME); useEffect(() => { function onMessage(event: MessageEvent) { @@ -93,7 +94,7 @@ function Index() { {messages.map((message, i) => ( ("hat") || ""; const frog = await this.ctx.storage.get("frog") || "Frog1AP"; - const name = await this.ctx.storage.get("name") || "frogboi"; + const name = await this.ctx.storage.get("name") || DEFAULT_NAME; this.broadcast(getMessageForClient({ type: "svg_uploaded", @@ -51,7 +51,7 @@ export class Chat extends Server { case "request-frog": { const hat = await this.ctx.storage.get("hat") || ""; const frog = await this.ctx.storage.get("frog") || "Frog1AP"; - const name = await this.ctx.storage.get("name") || "frogboi"; + const name = await this.ctx.storage.get("name") || DEFAULT_NAME; connection.send(getMessageForClient({ type: "get_frog", hat, @@ -64,7 +64,7 @@ export class Chat extends Server { case "change-frog": { this.ctx.storage.put("hat", data.hat); this.ctx.storage.put("frog", data.frog); - const name = await this.ctx.storage.get("name") || "frogboi"; + const name = await this.ctx.storage.get("name") || DEFAULT_NAME; this.broadcast(getMessageForClient({ type: "frog_changed", hat: data.hat,