mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: add information when the time to charge/discharge is unavailable
This commit is contained in:
@@ -231,11 +231,15 @@ internal class Popup: NSView, Popup_p {
|
||||
self.timeLabelField?.stringValue = "\(LocalizedString("Time to discharge")):"
|
||||
if value.timeToEmpty != -1 && value.timeToEmpty != 0 {
|
||||
self.timeField?.stringValue = Double(value.timeToEmpty*60).printSecondsToHoursMinutesSeconds(short: self.timeFormat == "short")
|
||||
} else {
|
||||
self.timeField?.stringValue = LocalizedString("Unknown")
|
||||
}
|
||||
} else {
|
||||
self.timeLabelField?.stringValue = "\(LocalizedString("Time to charge")):"
|
||||
if value.timeToCharge != -1 && value.timeToCharge != 0 {
|
||||
self.timeField?.stringValue = Double(value.timeToCharge*60).printSecondsToHoursMinutesSeconds(short: self.timeFormat == "short")
|
||||
} else {
|
||||
self.timeField?.stringValue = LocalizedString("Unknown")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user