mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 01:22:41 +00:00
Fixed mark empty chat as read
This commit is contained in:
parent
55d5c78e78
commit
5d6a5ee3f9
@ -134,6 +134,8 @@ public func togglePeerUnreadMarkInteractively(transaction: Transaction, viewTrac
|
||||
if setToValue == nil || !(setToValue!) {
|
||||
if let index = transaction.getTopPeerMessageIndex(peerId: peerId, namespace: namespace) {
|
||||
let _ = transaction.applyInteractiveReadMaxIndex(index)
|
||||
} else {
|
||||
transaction.applyMarkUnread(peerId: peerId, namespace: namespace, value: false, interactive: true)
|
||||
}
|
||||
viewTracker.updateMarkAllMentionsSeen(peerId: peerId)
|
||||
}
|
||||
|
||||
@ -58,8 +58,8 @@ public func recentlySearchedPeers(postbox: Postbox) -> Signal<[RecentlySearchedP
|
||||
var unreadCounts: [PeerId: Int32] = [:]
|
||||
if let unreadCountsView = view.views[unreadCountsKey] as? UnreadMessageCountsView {
|
||||
for entry in unreadCountsView.entries {
|
||||
if case let .peer(peerId, count) = entry {
|
||||
unreadCounts[peerId] = count
|
||||
if case let .peer(peerId, state) = entry {
|
||||
unreadCounts[peerId] = state?.count ?? 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user