Skip to content

Commit

Permalink
fix: changed the way the battery status is render in sidebarmenu
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagohernandez committed Aug 24, 2023
1 parent b74c04d commit 258addc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/renderer/component/Battery/PileIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import React, { useState, useEffect } from "react";

interface PileIndicatorProps {
batteryLevel: number;
isCharging: boolean;
batteryStatus: number;
}
const PileIndicator = ({ batteryLevel, isCharging, batteryStatus }: PileIndicatorProps) => {
const PileIndicator = ({ batteryLevel, batteryStatus }: PileIndicatorProps) => {
const [batteryWidth, setBatteryWidth] = useState(0);
// console.log("isCharging", isCharging);
// console.log("batteryStatus", batteryStatus);
Expand Down Expand Up @@ -36,7 +35,7 @@ const PileIndicator = ({ batteryLevel, isCharging, batteryStatus }: PileIndicato
default:
setBatteryWidth(0);
}
}, [batteryLevel, isCharging, batteryStatus]);
}, [batteryLevel, batteryStatus]);

return (
<svg className="pileIndicator" width="22" height="16" viewBox="0 0 22 16" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
4 changes: 0 additions & 4 deletions src/renderer/modules/Battery/BatteryStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ const BatteryStatus = ({ disable }: BatteryStatusProps) => {
setsLeft(leftStatus.includes("0x") ? 255 : parseInt(leftStatus, 10));
setsRight(rightStatus.includes("0x") ? 255 : parseInt(rightStatus, 10));
setIsSavingMode(parseInt(savingMode, 10) > 0);
console.log("L: batteryLevel", bLeft);
console.log("L: batteryStatus", sLeft);
console.log("R: batteryLevel", bRight);
console.log("R: batteryStatus", sRight);
}

if (!disable) {
Expand Down

0 comments on commit 258addc

Please # to comment.