diff options
Diffstat (limited to 'shared/src/commonMain')
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt | 4 |
1 files changed, 4 insertions, 0 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 29c84f4..db6d9b3 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt @@ -51,6 +51,10 @@ class UnitsController( queryFlow.value = query } + fun getUnit(deviceId: Int): UnitInformation? { + return unitsFlow.value.firstOrNull { it.device.id == deviceId } + } + private suspend fun setupFlows() { unitsFlow.combine(queryFlow) { units, query -> units.filter { unit -> |