aboutsummaryrefslogtreecommitdiff
path: root/shared/src
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src')
-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 b282a34..a5d5bd7 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt
@@ -32,6 +32,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
@@ -49,14 +50,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")