diff options
author | Isidro Henoch <imhenoch@protonmail.com> | 2021-12-16 02:08:57 -0600 |
---|---|---|
committer | Isidro Henoch <imhenoch@protonmail.com> | 2021-12-16 02:08:57 -0600 |
commit | bab8bb576cd741ebd928d55539286580dad07db1 (patch) | |
tree | 166965a85371aca7553058cf5ec44db890d7fd36 /shared/src/commonMain | |
parent | 95af352c7ae6b7f06d3248aac18b3a65cefc803a (diff) | |
download | etbsa-trackermap-mobile-bab8bb576cd741ebd928d55539286580dad07db1.tar.gz etbsa-trackermap-mobile-bab8bb576cd741ebd928d55539286580dad07db1.tar.bz2 etbsa-trackermap-mobile-bab8bb576cd741ebd928d55539286580dad07db1.zip |
Updates unit details fragment to fetch the information for the given ID
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 -> |