diff --git a/client/src/Room.js b/client/src/Room.js index 708b20a..d3b2c97 100644 --- a/client/src/Room.js +++ b/client/src/Room.js @@ -111,7 +111,8 @@ class Room extends Component { const socket = this.socket; socket.emit("join", roomName); - let myName = ""; + // if the url has the user's name in `...?name=John...`, use it + let myName = new URLSearchParams(window.location.search).get("name") || ""; if ( this.props.location && this.props.location.state &&