mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Restore account presence manager updates
This commit is contained in:
parent
1b3cfcb124
commit
9eb8bf93a7
2 changed files with 10 additions and 2 deletions
|
|
@ -1196,7 +1196,7 @@ public class Account {
|
|||
self.accountPresenceManager.isPerformingUpdate() |> map { presenceUpdate in
|
||||
if presenceUpdate {
|
||||
print("accountPresenceManager isPerformingUpdate: true")
|
||||
return []
|
||||
//return []
|
||||
}
|
||||
return presenceUpdate ? AccountRunningImportantTasks.other : []
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ private final class AccountPresenceManagerImpl {
|
|||
private let currentRequestDisposable = MetaDisposable()
|
||||
private var onlineTimer: SignalKitTimer?
|
||||
|
||||
private var wasOnline: Bool = false
|
||||
|
||||
init(queue: Queue, shouldKeepOnlinePresence: Signal<Bool, NoError>, network: Network) {
|
||||
self.queue = queue
|
||||
self.network = network
|
||||
|
|
@ -23,7 +25,13 @@ private final class AccountPresenceManagerImpl {
|
|||
self.shouldKeepOnlinePresenceDisposable = (shouldKeepOnlinePresence
|
||||
|> distinctUntilChanged
|
||||
|> deliverOn(self.queue)).start(next: { [weak self] value in
|
||||
self?.updatePresence(value)
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
if self.wasOnline != value {
|
||||
self.wasOnline = value
|
||||
self.updatePresence(value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue