kopia lustrzana https://github.com/rt-bishop/Look4Sat
Now updating sources and entries on first launch
rodzic
d776b87232
commit
648da0094a
|
|
@ -53,7 +53,7 @@ class SharedViewModel @ViewModelInject constructor(
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (prefsManager.isFirstLaunch()) {
|
if (prefsManager.isFirstLaunch()) {
|
||||||
setDefaultTleSources()
|
updateDefaultSourcesAndEntries()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,14 +109,12 @@ class SharedViewModel @ViewModelInject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setDefaultTleSources() {
|
private fun updateDefaultSourcesAndEntries() {
|
||||||
viewModelScope.launch {
|
val defaultTleSources = listOf(
|
||||||
val defaultTleSources = listOf(
|
TleSource("https://celestrak.com/NORAD/elements/active.txt"),
|
||||||
TleSource("https://celestrak.com/NORAD/elements/active.txt"),
|
TleSource("https://amsat.org/tle/current/nasabare.txt")
|
||||||
TleSource("https://amsat.org/tle/current/nasabare.txt")
|
)
|
||||||
)
|
updateEntriesFromSources(defaultTleSources)
|
||||||
sourcesRepo.updateSources(defaultTleSources)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getPassesForEntries(
|
private fun getPassesForEntries(
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue