Fixed bug not copying attachment when using copy and send

This commit is contained in:
delvh 2020-07-18 09:48:08 +02:00
parent 2e45e375b1
commit da77afdc32
1 changed files with 5 additions and 0 deletions

View File

@ -560,9 +560,14 @@ public final class ChatScene implements Restorable {
private void copyAndPostMessage() {
final var messageText = messageTextArea.getText();
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(messageText), null);
final var image = attachmentView.getImage();
final var messageAttachment = pendingAttachment;
postMessage();
messageTextArea.setText(messageText);
updateRemainingCharsLabel();
postButton.setDisable(messageText.isBlank());
attachmentView.setImage(image);
if (attachmentView.getImage() != null) attachmentView.setVisible(true);
pendingAttachment = messageAttachment;
}
}