Nogroup if unchecked country

This commit is contained in:
soraefir 2024-04-10 21:48:57 +02:00
parent 445cd05800
commit c01420a3c6
Signed by: sora
GPG Key ID: A362EA0491E2EEA0

View File

@ -18,7 +18,13 @@ object GeoLocImporter {
while (fs.ready()) {
val line = fs.readLine().split("|")
val state = State(line[0], line[2], line[3].toInt())
Country.entries.find { it.code == line[1] }?.children?.add(state)
val country = Country.entries.find { it.code == line[1] }
country?.children?.add(state)
country?.let {
if (Data.visits.getVisited(it) == NO_GROUP) {
Data.visits.setVisited(state, NO_GROUP)
}
}
}
}