aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/mx
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-31 22:49:12 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-31 22:49:12 -0600
commit90a9f7028053b3c4a56b88fcc52de675db5b9ab9 (patch)
tree2c57fd6b04527f71cd9d25e79714c262c23bc91e /shared/src/commonMain/kotlin/mx
parent4c27908871393358aca92b333bc1785b468e4645 (diff)
parent9d753c9fa9e93171206e6036c1889ea17cac9db6 (diff)
downloadetbsa-trackermap-mobile-90a9f7028053b3c4a56b88fcc52de675db5b9ab9.tar.gz
etbsa-trackermap-mobile-90a9f7028053b3c4a56b88fcc52de675db5b9ab9.tar.bz2
etbsa-trackermap-mobile-90a9f7028053b3c4a56b88fcc52de675db5b9ab9.zip
Merge branch 'main' into ios_app
Diffstat (limited to 'shared/src/commonMain/kotlin/mx')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt6
1 files changed, 2 insertions, 4 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt
index fd1e950..8c36d50 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt
@@ -33,6 +33,7 @@ import mx.trackermap.TrackerMap.client.models.UnitInformation
import mx.trackermap.TrackerMap.utils.Coroutines
import kotlin.time.Duration.Companion.seconds
import kotlin.time.ExperimentalTime
+import kotlinx.coroutines.Job
@DelicateCoroutinesApi
@ExperimentalTime
@@ -50,14 +51,11 @@ class UnitsController(
init {
GlobalScope.launch {
- fetchUnits(this)
- }
- GlobalScope.launch {
setupFlows()
}
}
- private suspend fun fetchUnits(scope: CoroutineScope) {
+ fun fetchUnits(scope: CoroutineScope) {
Coroutines.tickerFlow(UPDATE_TIME.seconds)
.map {
print("Fetching new positions...\n")