mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Now updating sources and entries on first launch
This commit is contained in:
1 parent
d776b87232
commit
648da0094a
1 file changed
+7
-9
@@ -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(
|
||||||
|
|||||||
Reference in new issue
Block a user