Closed l0fl0 closed 2 years ago
Handle mounting of component.
Bug: if user closes the chat tab and re opens an new socket is connected
possible fixes can be storing the user socket on within the session and search for an existing socket id before creating a new connection.
alternatively upon connecting match the username with the existing list in the server to prevent prompt and reconnect;
Originally posted by @l0fl0 in https://github.com/l0fl0/brainstation-lounge/issues/6#issuecomment-1035672243
https://dev.to/bravemaster619/how-to-use-socket-io-client-correctly-in-react-app-o65
Handle mounting of component.
Bug: if user closes the chat tab and re opens an new socket is connected
possible fixes can be storing the user socket on within the session and search for an existing socket id before creating a new connection.
alternatively upon connecting match the username with the existing list in the server to prevent prompt and reconnect;
Originally posted by @l0fl0 in https://github.com/l0fl0/brainstation-lounge/issues/6#issuecomment-1035672243