File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ public void open(String initialQuestion) {
100100
101101 addItem (contents );
102102
103- ask (initialQuestion );
103+ if (initialQuestion !=null && !initialQuestion .isEmpty ())
104+ ask (initialQuestion );
104105
105106 show ();
106107 }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public class ChatGPTTray extends MenuTray {
2121 public ChatGPTTray () {
2222 TextItem question = ItemFactory .newTextItem ("chatgpt" , "" );
2323 question .setWidth (250 );
24+ question .setRequired (true );
2425 question .addKeyPressHandler (event -> {
2526 if (event .getKeyName () != null && "enter" .equalsIgnoreCase (event .getKeyName ()))
2627 onAsk (question .getValueAsString ());
@@ -37,6 +38,9 @@ public ChatGPTTray() {
3738 }
3839
3940 private void onAsk (String question ) {
41+ if (!validate ())
42+ return ;
43+
4044 if (DocumentController .get ().getCurrentSelection ().isEmpty ())
4145 SC .warn (I18N .message ("nodocsselected" ));
4246 else
You can’t perform that action at this time.
0 commit comments