only show runtime if nonzero

This commit is contained in:
sctanf committed 2025-12-15 09:16:30 -06:00
1 parent 09d44b51d6
commit d3eafb8d06
1 file changed
+2 -2
@@ -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) && (