Removed the selected user from ContactSearchScene upon addition

This commit is contained in:
delvh 2020-07-16 17:36:57 +02:00
parent f13dc3f389
commit ae41ab9637

View File

@ -118,7 +118,8 @@ public class ContactSearchScene {
final var event = new ContactOperation(user, ElementOperation.ADD); final var event = new ContactOperation(user, ElementOperation.ADD);
// Sends the event to the server // Sends the event to the server
eventBus.dispatch(new SendEvent(event)); eventBus.dispatch(new SendEvent(event));
// Updates the UI // Removes the chosen user and updates the UI
userList.getItems().remove(user);
eventBus.dispatch(event); eventBus.dispatch(event);
logger.log(Level.INFO, "Added user " + user); logger.log(Level.INFO, "Added user " + user);
})); }));