aboutsummaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-16 02:52:28 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-16 02:52:28 -0600
commit4ff66b74fa8f647e988f909ee0e0239b542f7fdd (patch)
tree0049335782d9ed10242ca994c3c111268768b94e /shared
parent04b33cf071672a955c3e3229f8d48de4c215dc18 (diff)
parent6ed24f2be979187d90ab3250d02d8b71fc570535 (diff)
downloadetbsa-trackermap-mobile-4ff66b74fa8f647e988f909ee0e0239b542f7fdd.tar.gz
etbsa-trackermap-mobile-4ff66b74fa8f647e988f909ee0e0239b542f7fdd.tar.bz2
etbsa-trackermap-mobile-4ff66b74fa8f647e988f909ee0e0239b542f7fdd.zip
Merge remote-tracking branch 'origin/main'
# Conflicts: # androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt # androidApp/src/main/res/layout/unit_item.xml
Diffstat (limited to 'shared')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt4
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 ->