Open TkachenkoViacheslav opened 2 months ago
Solution: 1) the condition above should be changed to the:
if disableSystemVolumeHandler && newVolume == oldVolume {
// Resetting volume, skip blocks
return
} else { ...
2) at the end of function "public override func observeValue(...)" the "Reset volume method" should be wrapped in an If statement:
// Reset volume
if newVolume != Float(initialVolume) {
setSystemVolume(initialVolume)
}
I'm sorry, my solution is wrong. But the bug is actual
Steps to reproduce (it's hard and not always reproducible): 1) disableSystemVolumeHandler = true 2) with a delay about 1-2 seconds click "up" -> "down" -> "up" -> "down" -> ... 3) On some time, pressing on the up/down button won't result in firing blocks, In code inside "public override func observeValue(...)" we are getting into the next If block:
but in fact button press was detected and newVolume != oldValue