Im creating a Queue System in Node(SocketIO) VueJS MySQL, but after 5 people join it has to create a new chat room (I already got the component created and a main chat) that displays only those were in the queue, I cant find a way to create another chat component, i'd like to know if there is a way to do that?
I'm stuck around 2 weeks trying to figure out how to get this.
Any extra information just ask, please I really need to know how to get this
CodePudding user response:
(Rep too low to post comment, would have done so instead otherwise).
I'd suggest to hide the existence of chat rooms from the frontend, and only tell it about one chat room. The backend would have a list of many rooms and each would have at most 5 people in it. When the frontend connects with socket.io then you can tell it about the people who are in the chatroom with them.
This means the frontend code only knows about your 5-people chatroom and not about any others. That makes the frontend-side simpler because you only have to show a single chatroom.
The trick then is to manage this correctly in the backend.
CodePudding user response:
I agree with the previous answer
Just display the chat component and fetch the right data depending on the current user (for example which room he's in, and what people are with in etc...)
Hope you'll figure it out ;)