Skip to content

Commit 4e864f6

Browse files
authored
Fix ai chat not on fx thread (JabRef#11796)
* Fix ai chat not on fx thread Fixes JabRef/jabref-issue-melting-pot#549 * fix import
1 parent c5e81a9 commit 4e864f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.jabref.gui.ai.components.util.notifications.Notification;
2222
import org.jabref.gui.ai.components.util.notifications.NotificationsComponent;
2323
import org.jabref.gui.icon.IconTheme;
24+
import org.jabref.gui.util.UiTaskExecutor;
2425
import org.jabref.logic.ai.AiPreferences;
2526
import org.jabref.logic.ai.AiService;
2627
import org.jabref.logic.ai.chatting.AiChatLogic;
@@ -140,7 +141,7 @@ private void updateNotifications() {
140141
notificationsButton.setManaged(!notifications.isEmpty());
141142

142143
if (!notifications.isEmpty()) {
143-
notificationsButton.setGraphic(IconTheme.JabRefIcons.WARNING.withColor(Color.YELLOW).getGraphicNode());
144+
UiTaskExecutor.runInJavaFXThread(() -> notificationsButton.setGraphic(IconTheme.JabRefIcons.WARNING.withColor(Color.YELLOW).getGraphicNode()));
144145
}
145146
}
146147

0 commit comments

Comments
 (0)