mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Fix empty chat node
This commit is contained in:
parent
a3b8870065
commit
c522d7f67d
1 changed files with 11 additions and 7 deletions
|
|
@ -1743,15 +1743,19 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||
|
||||
let loadState: ChatHistoryNodeLoadState
|
||||
if let historyView = strongSelf.historyView {
|
||||
if let firstEntry = historyView.originalView.entries.first, historyView.filteredEntries.isEmpty {
|
||||
var isPeerJoined = false
|
||||
for media in firstEntry.message.media {
|
||||
if let action = media as? TelegramMediaAction, action.action == .peerJoined {
|
||||
isPeerJoined = true
|
||||
break
|
||||
if historyView.filteredEntries.isEmpty {
|
||||
if let firstEntry = historyView.originalView.entries.first {
|
||||
var isPeerJoined = false
|
||||
for media in firstEntry.message.media {
|
||||
if let action = media as? TelegramMediaAction, action.action == .peerJoined {
|
||||
isPeerJoined = true
|
||||
break
|
||||
}
|
||||
}
|
||||
loadState = .empty(isPeerJoined ? .joined : .generic)
|
||||
} else {
|
||||
loadState = .empty(.generic)
|
||||
}
|
||||
loadState = .empty(isPeerJoined ? .joined : .generic)
|
||||
} else {
|
||||
loadState = .messages
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue