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 | 84c797ac104c0fff96ba6793cefaa5ba0b4887fc (patch) | |
tree | 96f30f5f6c939a4683a69ae47b65b720d1830dbb /shared/src | |
parent | 36b7d109fa1e8c5a7c5fc262a3b0d7b1286e07c8 (diff) | |
download | etbsa-trackermap-mobile-84c797ac104c0fff96ba6793cefaa5ba0b4887fc.tar.gz etbsa-trackermap-mobile-84c797ac104c0fff96ba6793cefaa5ba0b4887fc.tar.bz2 etbsa-trackermap-mobile-84c797ac104c0fff96ba6793cefaa5ba0b4887fc.zip |
Updates unit details fragment to fetch the information for the given ID
Diffstat (limited to 'shared/src')
-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 -> |