fix(ui): Hide battery icon when no power data is available (#4274)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-01-20 21:41:49 -06:00 committed by GitHub
parent 7173a2da99
commit 932c31c2b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,11 +153,13 @@ fun NodeItem(
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {
MaterialBatteryInfo(
level = thatNode.batteryLevel,
voltage = thatNode.voltage,
contentColor = contentColor,
)
if (thatNode.batteryLevel > 0 || thatNode.voltage > 0f) {
MaterialBatteryInfo(
level = thatNode.batteryLevel,
voltage = thatNode.voltage,
contentColor = contentColor,
)
}
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically,