Compat with latest JS lib

This commit is contained in:
Sacha Weatherstone
2023-01-19 19:46:29 +10:00
parent 8ddb900f81
commit d538ba5a9d
51 changed files with 800 additions and 1027 deletions
+3 -3
View File
@@ -30,12 +30,12 @@ export const BatteryWidget = ({
let previousStat: number | undefined = undefined;
let previousTime = new Date();
for (const stat of [...stats].reverse()) {
if (stat.batteryLevel) {
if (stat.metric.batteryLevel) {
if (!currentStat) {
currentStat = stat.batteryLevel;
currentStat = stat.metric.batteryLevel;
currentTime = stat.timestamp;
} else {
previousStat = stat.batteryLevel;
previousStat = stat.metric.batteryLevel;
previousTime = stat.timestamp;
break;
}