mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Restore account presence manager updates
This commit is contained in:
parent
1b3cfcb124
commit
9eb8bf93a7
@ -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…
x
Reference in New Issue
Block a user