Closed vocatwk closed 6 years ago
Okay, I'll try and find a better way.
I was thinking of disabling the add Users button when the search results are populated if the user is already a member or if it's already queued up. I could maintain a list of the ones that are queued up whenever the modal opens and find a way to clear this list when the modal closes. What do you guys think?
If you can maintain a list of the queued up users, so that you can check before adding the "Add" button when the search results come back, that would be a good fix. Where were you thinking of maintaining such a list?
Well I haven't tried it out yet(I'm about to) but I was thinking of initializing an empty list when the page first loads in chat.jsp (inside a script tag) and then adding users to it accordingly.
Clicking the add button next to a user's name will now select a user to be added to the group. Clicking add users will send a PUT request with the list of users selected, close the modal and clear the list. This is just getting the list of selected user's to the chat servlet, I haven't done anything with that list yet.
I'm working on adding a close icon on each tag that shows up on top of the search bar so users can deselect and having the add users button deactivated atleast until one user is selected.
I also added a header to differentiaite between changing chat privacy PUT request and adding users PUT request.