devs-coffee / frontend-collab-chat-project

frontend for the collaborative project of a chat app
MIT License
3 stars 0 forks source link

Feature get server connected users #64

Closed WhitedogWarren closed 1 year ago

WhitedogWarren commented 1 year ago

In this feature, the ServerDisplay page now has a user list that shows if users are connected with a green badge. When the component is mounted, a WS event is sent ( getServerConnectedUsers ) to backend. In response, backend sends a 'serverUserList' event, containing the list of id of connected users. When a user connects or disconnects, the backend sends events ( 'userJoined' or 'userLeft' ) containing the id of the user, so ServerDisplay components can update badges on the user list.