Battery: Do not show time remaining if rate is zero

This commit is contained in:
o9000 2017-09-17 14:09:48 +02:00
parent 1772d0a894
commit fc61676732

View file

@ -197,7 +197,7 @@ void battery_update_text(char *dest, char *format)
if (battery_state.state == BATTERY_FULL) {
snprintf(buf, sizeof(buf), "Full");
strnappend(dest, buf, BATTERY_BUF_SIZE);
} else {
} else if (battery_state.time.hours > 0 && battery_state.time.minutes > 0) {
snprintf(buf, sizeof(buf), "%02d:%02d", battery_state.time.hours, battery_state.time.minutes);
strnappend(dest, buf, BATTERY_BUF_SIZE);
}