Fix comparison that determines which list item is the primary device. (#54)

This commit is contained in:
Matthias Urhahn
2022-11-07 19:42:31 +01:00
committed by GitHub
parent 1da220085c
commit f59e9d2dc5
2 changed files with 6 additions and 3 deletions
@@ -130,24 +130,25 @@ class OverviewFragmentVM @Inject constructor(
if (permissions.isEmpty() && isBluetoothEnabled) {
pods.map {
val now = Instant.now()
val isMainPod = it.identifier == mainPod?.identifier
when (it) {
is DualPodDevice -> DualPodsCardVH.Item(
now = now,
device = it,
showDebug = isDebugMode,
isMainPod = it == mainPod,
isMainPod = isMainPod,
)
is SinglePodDevice -> SinglePodsCardVH.Item(
now = now,
device = it,
showDebug = isDebugMode,
isMainPod = it == mainPod,
isMainPod = isMainPod,
)
else -> UnknownPodDeviceCardVH.Item(
now = now,
device = it,
showDebug = isDebugMode,
isMainPod = it == mainPod,
isMainPod = isMainPod,
)
}
}.run { items.addAll(this) }