mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Merge commit 'c474162cff04778f12bcaf22517306784026d0ac' into 189layer
This commit is contained in:
@@ -1808,14 +1808,19 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
||||
self.isActiveValue = false
|
||||
self.isActivePromise.set(false)
|
||||
|
||||
var taskId: UIBackgroundTaskIdentifier?
|
||||
taskId = application.beginBackgroundTask(withName: "lock", expirationHandler: {
|
||||
if let taskId = taskId {
|
||||
final class TaskIdHolder {
|
||||
var taskId: UIBackgroundTaskIdentifier?
|
||||
}
|
||||
|
||||
let taskIdHolder = TaskIdHolder()
|
||||
|
||||
taskIdHolder.taskId = application.beginBackgroundTask(withName: "lock", expirationHandler: {
|
||||
if let taskId = taskIdHolder.taskId {
|
||||
UIApplication.shared.endBackgroundTask(taskId)
|
||||
}
|
||||
})
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 5.0, execute: {
|
||||
if let taskId = taskId {
|
||||
if let taskId = taskIdHolder.taskId {
|
||||
UIApplication.shared.endBackgroundTask(taskId)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user