From c52982e19620b46b6b050db3d8e5d1b991df34f5 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R 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); } /**