mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Don't count battery level as low if it's not available (lower than zero)
This commit is contained in:
@@ -641,7 +641,7 @@ public final class PresentationCallImpl: PresentationCall {
|
||||
|
||||
var previousBatteryLevelIsLow = false
|
||||
let timer = SwiftSignalKit.Timer(timeout: 30.0, repeat: true, completion: {
|
||||
let batteryLevelIsLow = device.batteryLevel < 0.1 && device.batteryState != .charging
|
||||
let batteryLevelIsLow = device.batteryLevel >= 0.0 && device.batteryLevel < 0.1 && device.batteryState != .charging
|
||||
if batteryLevelIsLow != previousBatteryLevelIsLow {
|
||||
previousBatteryLevelIsLow = batteryLevelIsLow
|
||||
subscriber.putNext(batteryLevelIsLow)
|
||||
|
||||
Reference in New Issue
Block a user