mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 08:07:18 +02:00
Update battery stat
This commit is contained in:
parent
5facfd2348
commit
d9288a322b
@ -116,9 +116,10 @@ class StreamBadges {
|
||||
const currentLevel = (await navigator.getBattery()).level * 100;
|
||||
batteryLevel = `${currentLevel}%`;
|
||||
|
||||
if (currentLevel < StreamBadges.startBatteryLevel) {
|
||||
const diffLevel = StreamBadges.startBatteryLevel - currentLevel;
|
||||
batteryLevel += ` (-${diffLevel}%)`;
|
||||
if (currentLevel != StreamBadges.startBatteryLevel) {
|
||||
const diffLevel = currentLevel - StreamBadges.startBatteryLevel;
|
||||
const sign = diffLevel > 0 ? '+' : '';
|
||||
batteryLevel += ` (${sign}${diffLevel}%)`;
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user