Merge pull request #367 from mpretty-cyro/fix/leave-conversation-screen-crash

Fixed a crash which could occur when leaving the conversation screen
pull/1061/head
Morgan Pretty 3 months ago committed by GitHub
commit 9c12265544
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -133,6 +133,12 @@ final class MainAppContext: AppContext {
}
func setStatusBarHidden(_ isHidden: Bool, animated isAnimated: Bool) {
guard Thread.isMainThread else {
return DispatchQueue.main.async { [weak self] in
self?.setStatusBarHidden(isHidden, animated: isAnimated)
}
}
UIApplication.shared.setStatusBarHidden(isHidden, with: (isAnimated ? .slide : .none))
}
@ -154,6 +160,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))"
@ -171,6 +183,12 @@ final class MainAppContext: AppContext {
}
func setNetworkActivityIndicatorVisible(_ value: Bool) {
guard Thread.isMainThread else {
return DispatchQueue.main.async { [weak self] in
self?.setNetworkActivityIndicatorVisible(value)
}
}
UIApplication.shared.isNetworkActivityIndicatorVisible = value
}

Loading…
Cancel
Save