only show runtime if nonzero

This commit is contained in:
sctanf
2025-12-13 21:11:23 -06:00
parent 09d44b51d6
commit d3eafb8d06

View File

@@ -39,12 +39,12 @@ export function TrackerBattery({
</div>
{((!charging || showVoltage) && (
<div className="w-15">
{!charging && runtime != null && (
{!charging && runtime != null && runtime > 0 && (
<Typography color={textColor}>
{(runtime / BigInt(3600000000)).toString() +
'h ' +
((runtime % BigInt(3600000000)) / BigInt(60000000)).toString() +
'min' || 'N/A'}
'min'}
</Typography>
)}
{!charging && (!runtime || showVoltage) && (