From 4c79141e291a1873a11bd48d9bdb44ad6ca489d6 Mon Sep 17 00:00:00 2001 From: kske Date: Sat, 6 Jun 2020 15:29:29 +0200 Subject: [PATCH] Fix condition for posting messages --- src/main/java/envoy/client/ui/ChatSceneController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/envoy/client/ui/ChatSceneController.java b/src/main/java/envoy/client/ui/ChatSceneController.java index 68eca80..d2a77d9 100644 --- a/src/main/java/envoy/client/ui/ChatSceneController.java +++ b/src/main/java/envoy/client/ui/ChatSceneController.java @@ -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); } /**