mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Manually set display link driver activity
This commit is contained in:
parent
ad04c5de8a
commit
eeb5513e00
@ -126,6 +126,13 @@ public final class SharedDisplayLinkDriver {
|
||||
self.update()
|
||||
}
|
||||
|
||||
public func updateForegroundState(_ isActive: Bool) {
|
||||
if self.isInForeground != isActive {
|
||||
self.isInForeground = isActive
|
||||
self.update()
|
||||
}
|
||||
}
|
||||
|
||||
private func requestUpdate() {
|
||||
self.update()
|
||||
}
|
||||
|
@ -1311,6 +1311,8 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
||||
self.isActiveValue = true
|
||||
self.isActivePromise.set(true)
|
||||
|
||||
SharedDisplayLinkDriver.shared.updateForegroundState(self.isActiveValue)
|
||||
|
||||
self.runForegroundTasks()
|
||||
}
|
||||
|
||||
@ -1523,6 +1525,8 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
||||
}
|
||||
|
||||
self.runForegroundTasks()
|
||||
|
||||
SharedDisplayLinkDriver.shared.updateForegroundState(self.isActiveValue)
|
||||
}
|
||||
|
||||
func runForegroundTasks() {
|
||||
@ -1548,6 +1552,8 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
||||
self.resetBadge()
|
||||
|
||||
self.maybeCheckForUpdates()
|
||||
|
||||
SharedDisplayLinkDriver.shared.updateForegroundState(self.isActiveValue)
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user