Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorFilimonov committed Sep 15, 2024
1 parent b53b53e commit 10a01b5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ class TestsController(val openedAutomaton: Automaton) : Controller() {
mode = mode,
owner = testsWindow.currentWindow,
initialFileName = openedAutomaton.name + "_tests"
).firstOrNull()
).firstOrNull()?.let { file ->
if (mode == FileChooserMode.Save && file.extension.isEmpty())
File(file.path + ".json")
else file
}

private fun defaultDirectory() = runCatching {
File("${System.getProperty("user.home")}/Documents/automaton-constructor").takeIf { it.isDirectory || it.mkdirs() }
Expand Down

0 comments on commit 10a01b5

Please sign in to comment.