🔋 Workaround for full battery
The `systeminformation` can return false for `BatteryData.acConnected` and `BatteryData.isCharging`, when battery charged to 100%
This commit is contained in:
parent
dba42b9a00
commit
3ffd601de7
1 changed files with 1 additions and 1 deletions
|
|
@ -22,8 +22,8 @@ export class Battery implements Disposable {
|
|||
|
||||
private async update() {
|
||||
const stats = await si.battery();
|
||||
const isACConnected = !stats.hasBattery || stats.acConnected;
|
||||
const level = stats.hasBattery ? stats.percent : 100;
|
||||
const isACConnected = !stats.hasBattery || stats.acConnected || level == 100;
|
||||
|
||||
if (isACConnected !== this.acConnected) {
|
||||
this.acConnected = isACConnected;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue