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();
threadPool.execute(() -> {
TextArea textArea = controller.openAssociatedFileAndCreateTextArea(rawParameters);
if (!Objects.isNull(textArea)) {
Platform.runLater(() -> updateUIWithNewTextArea(textArea));
}
});
}
}

View File

@ -35,13 +35,13 @@ 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;
}
}
/**
* 获取行分隔事件处理程序