fix: 关联文件打开会出现两个tap

This commit is contained in:
kb 2023-08-14 22:51:55 +08:00
parent d680623993
commit 0ba9794b8e
2 changed files with 8 additions and 6 deletions

View File

@ -56,7 +56,9 @@ public class LunchApp extends Application {
List<String> rawParameters = getParameters().getRaw(); List<String> rawParameters = getParameters().getRaw();
threadPool.execute(() -> { threadPool.execute(() -> {
TextArea textArea = controller.openAssociatedFileAndCreateTextArea(rawParameters); TextArea textArea = controller.openAssociatedFileAndCreateTextArea(rawParameters);
Platform.runLater(() -> updateUIWithNewTextArea(textArea)); if (!Objects.isNull(textArea)) {
Platform.runLater(() -> updateUIWithNewTextArea(textArea));
}
}); });
} }
} }

View File

@ -35,12 +35,12 @@ public class Controller implements ControllerInterface {
if (!rawParameters.isEmpty()) { if (!rawParameters.isEmpty()) {
String filePath = rawParameters.get(0); String filePath = rawParameters.get(0);
openAssociatedFile(filePath); openAssociatedFile(filePath);
return null;
} else {
TextArea textArea = createNewTextArea();
configureTextArea(textArea);
return textArea;
} }
TextArea textArea = createNewTextArea();
configureTextArea(textArea);
return textArea;
} }
/** /**