Fixed createButton disabling bug
This commit is contained in:
@ -61,7 +61,9 @@ public class GroupCreationTab {
|
||||
userList.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
|
||||
|
||||
eventBus.register(LoadGroupCreationEvent.class, e -> {
|
||||
createButton.setDisable(true);
|
||||
this.localDB = e.get();
|
||||
userList.getItems().clear();
|
||||
Platform.runLater(() -> userList.getItems()
|
||||
.addAll(localDB.getChats()
|
||||
.stream()
|
||||
@ -90,7 +92,7 @@ public class GroupCreationTab {
|
||||
* @since Envoy Client v0.1-beta
|
||||
*/
|
||||
@FXML
|
||||
private void textUpdated() { createButton.setDisable(groupNameField.getText().isBlank()); }
|
||||
private void textUpdated() { createButton.setDisable(userList.getSelectionModel().isEmpty() || groupNameField.getText().isBlank()); }
|
||||
|
||||
/**
|
||||
* Sends a {@link GroupCreation} to the server and closes this scene.
|
||||
@ -114,6 +116,7 @@ public class GroupCreationTab {
|
||||
new Alert(AlertType.INFORMATION, String.format("Group '%s' successfully created.", name)).showAndWait();
|
||||
createGroup(name);
|
||||
}
|
||||
eventBus.dispatch(new BackEvent());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user