mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-12 05:51:28 +00:00
fix: chat UI threading issues (fixes #730)
This commit is contained in:
parent
020e1aff7f
commit
6363053277
1 changed files with 5 additions and 10 deletions
|
|
@ -273,10 +273,10 @@ public class ChatMessageResponseBody extends JPanel {
|
|||
|
||||
private void processText(String markdownText, boolean caretVisible) {
|
||||
var html = convertMdToHtml(markdownText);
|
||||
if (currentlyProcessedTextPane == null) {
|
||||
prepareProcessingText(caretVisible);
|
||||
}
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
if (currentlyProcessedTextPane == null) {
|
||||
prepareProcessingText(caretVisible);
|
||||
}
|
||||
currentlyProcessedTextPane.setText(html);
|
||||
});
|
||||
}
|
||||
|
|
@ -285,17 +285,12 @@ public class ChatMessageResponseBody extends JPanel {
|
|||
if (highlightedText != null
|
||||
&& !highlightedText.isEmpty()
|
||||
&& currentlyProcessedEditorPanel != null) {
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
currentlyProcessedEditorPanel.showEditorActions();
|
||||
});
|
||||
currentlyProcessedEditorPanel.showEditorActions();
|
||||
}
|
||||
|
||||
currentlyProcessedEditorPanel = null;
|
||||
currentlyProcessedTextPane = createTextPane("", caretVisible);
|
||||
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
add(currentlyProcessedTextPane);
|
||||
});
|
||||
add(currentlyProcessedTextPane);
|
||||
}
|
||||
|
||||
private void prepareProcessingCode(String code, String markdownLanguage) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue