diff --git a/src/components/Widgets/BatteryWidget.tsx b/src/components/Widgets/BatteryWidget.tsx index d4834dc7..5a3015d8 100644 --- a/src/components/Widgets/BatteryWidget.tsx +++ b/src/components/Widgets/BatteryWidget.tsx @@ -45,38 +45,38 @@ export const BatteryWidget = ({ if (currentStat && previousStat) { const timeDiff = currentTime.getTime() - previousTime.getTime(); const statDiff = Math.abs(currentStat - previousStat); - //convert to ms/% - const msPerPercent = timeDiff / statDiff; - const formatted = prettyMilliseconds( - (100 - currentStat) * msPerPercent - ); - setTimeRemaining(formatted); + if (statDiff !== 0) { + //convert to ms/% + const msPerPercent = timeDiff / statDiff; + const formatted = prettyMilliseconds( + (100 - currentStat) * msPerPercent + ); + setTimeRemaining(formatted); + } } else setTimeRemaining("Unknown"); } }, [hardware.myNodeNum, nodes]); return ( -
+
Battery State
- -{batteryLevel}%
-- - {timeRemaining} -
-{batteryLevel}%
++ Connected Peers +
++ {`${peers.length} ${peers.length > 1 ? "Peers" : "Peer"}`} +
+ ) : ( ++
Current Location
- -{grid}
-{grid}
+