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

Merge pull request !4 from 一个大转盘/master
This commit is contained in:
Luke 2023-08-14 15:39:27 +00:00 committed by Gitee
commit a9ffa47801
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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();
threadPool.execute(() -> {
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()) {
String filePath = rawParameters.get(0);
openAssociatedFile(filePath);
return null;
} else {
TextArea textArea = createNewTextArea();
configureTextArea(textArea);
return textArea;
}
TextArea textArea = createNewTextArea();
configureTextArea(textArea);
return textArea;
}
/**