Fixed bug with hasData not being cleared and improved sapling tree selection.

- Choose the latest tree above the requested height
This commit is contained in:
Kevin Gorham 2019-12-23 14:47:58 -05:00
parent 596bea0158
commit 7babe0c63c
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
2 changed files with 5 additions and 3 deletions

View File

@ -183,6 +183,7 @@ class Initializer(
*/ */
fun clear() { fun clear() {
rustBackend.clear() rustBackend.clear()
prefs[PREFS_HAS_DATA] = false
} }
/** /**
@ -294,9 +295,10 @@ class Initializer(
) )
val file: String val file: String
try { try {
file = treeFiles.first() { file = if (birthdayHeight == null) treeFiles.first() else {
if (birthdayHeight == null) true treeFiles.first {
else it.contains(birthdayHeight.toString()) it.split(".").first().toInt() <= birthdayHeight
}
} }
} catch (t: Throwable) { } catch (t: Throwable) {
throw BirthdayException.BirthdayFileNotFoundException( throw BirthdayException.BirthdayFileNotFoundException(