Fixed a crash which could occur when leaving the conversation screen

pull/1061/head
Morgan Pretty 2 months ago
parent a13f5ae253
commit 3887a8902e

@ -154,6 +154,12 @@ final class MainAppContext: AppContext {
// stringlint:ignore_contents
func ensureSleepBlocking(_ shouldBeBlocking: Bool, blockingObjects: [Any]) {
guard Thread.isMainThread else {
return DispatchQueue.main.async { [weak self] in
self?.ensureSleepBlocking(shouldBeBlocking, blockingObjects: blockingObjects)
}
}
if UIApplication.shared.isIdleTimerDisabled != shouldBeBlocking {
if shouldBeBlocking {
var logString: String = "Blocking sleep because of: \(String(describing: blockingObjects.first))"

Loading…
Cancel
Save