Fix condition for posting messages

This commit is contained in:
Kai S. K. Engelbart 2020-06-06 15:29:29 +02:00
parent 7a1eda91d2
commit c52982e196

View File

@ -137,8 +137,10 @@ public final class ChatSceneController {
@FXML
private void messageTextUpdated(KeyEvent e) {
if (settings.isEnterToSend() && e.getCode() == KeyCode.ENTER || !settings.isEnterToSend() && e.getCode() == KeyCode.CONTROL) postMessage();
else postButton.setDisable(messageTextArea.getText().isBlank());
if (!postButton.isDisabled() && settings.isEnterToSend() && e.getCode() == KeyCode.ENTER
|| !settings.isEnterToSend() && e.getCode() == KeyCode.CONTROL)
postMessage();
else postButton.setDisable(messageTextArea.getText().isBlank() || currentChat == null);
}
/**