Added charging state to the uploader battery pill when it's provided by AAPSClientV3. (#7873)

Co-authored-by: Sulka Haro <sulka@sulka.net>
This commit is contained in:
Michael Kroes
2023-02-18 09:10:49 +02:00
committed by GitHub
co-authored by Sulka Haro
parent d1fe8f50da
commit 0f69153779
+2 -1
View File
@@ -72,6 +72,7 @@ function init(ctx) {
var battery = uploaderStatus.battery;
var voltage = uploaderStatus.batteryVoltage;
var charging = status.isCharging ? status.isCharging : false;
var voltageDisplay;
if (voltage) {
@@ -93,7 +94,7 @@ function init(ctx) {
uploaderStatus.voltageDisplay = voltageDisplay;
}
uploaderStatus.display = battery ? battery + '%' : voltageDisplay;
uploaderStatus.display = (battery ? battery + '%' : voltageDisplay) + (charging ? "⚡" : "");
if (battery >= 95) {
uploaderStatus.level = 100;