l0fl0 / brainstation-lounge

A lounge built for BrainStation students by BrainStation students.
https://bslounge.loflo.dev/
2 stars 0 forks source link

Handle mounting of Chat component. #8

Closed l0fl0 closed 2 years ago

l0fl0 commented 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;

Screen Shot 2022-02-10 at 7 13 56 PM

Originally posted by @l0fl0 in https://github.com/l0fl0/brainstation-lounge/issues/6#issuecomment-1035672243

l0fl0 commented 2 years ago

https://dev.to/bravemaster619/how-to-use-socket-io-client-correctly-in-react-app-o65