Explorar o código

Cancel battery alert when phone is plugged in (#547)

Fixes #540
SirTyson %!s(int64=7) %!d(string=hai) anos
pai
achega
2d326a0839
Modificáronse 2 ficheiros con 250 adicións e 240 borrados
  1. 240 240
      package-lock.json
  2. 10 0
      src/services/battery.ts

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 240 - 240
package-lock.json


+ 10 - 0
src/services/battery.ts

@@ -61,6 +61,16 @@ export class BatteryStatusService {
             }
         }
 
+        // Reset alert flag if device is plugged in
+        if (this.alertedLow && batteryStatus.isCharging) {
+            this.alertedLow = false;
+            this.notificationService.hideNotification('battery-low');
+        }
+        if (this.alertedCritical && batteryStatus.isCharging) {
+            this.alertedCritical = false;
+            this.notificationService.hideNotification('battery-critical');
+        }
+
         // Reset alert flag if percentage goes above a certain threshold
         const hysteresis = 3;
         if (this.alertedLow && batteryStatus.percent > BatteryStatusService.PERCENT_LOW + hysteresis) {

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio