Merge commit 'd16de905c5257614289c64a077152220869bec5d' into boosts-v2

This commit is contained in:
Ilya Laktyushin
2023-09-29 13:23:40 +04:00
19 changed files with 369 additions and 322 deletions

View File

@@ -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)
}
})
}