diff --git a/submodules/ChatListUI/Sources/ChatListController.swift b/submodules/ChatListUI/Sources/ChatListController.swift index 5e49e76a50..176fdea413 100644 --- a/submodules/ChatListUI/Sources/ChatListController.swift +++ b/submodules/ChatListUI/Sources/ChatListController.swift @@ -1678,18 +1678,17 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController, public func activateSearch() { if self.displayNavigationBar { - let _ = (self.chatListDisplayNode.containerNode.currentItemNode.contentsReady - |> take(1) - |> deliverOnMainQueue).start(completed: { [weak self] in + let _ = (combineLatest(self.chatListDisplayNode.containerNode.currentItemNode.contentsReady |> take(1), self.context.account.postbox.tailChatListView(groupId: .root, count: 16, summaryComponents: ChatListEntrySummaryComponents(tagSummary: nil, actionsSummary: nil)) |> take(1)) + |> deliverOnMainQueue).start(next: { [weak self] _, chatListView in guard let strongSelf = self else { return } if let scrollToTop = strongSelf.scrollToTop { scrollToTop() } - + var displaySearchFilters = true - if strongSelf.chatListDisplayNode.containerNode.mainItemNode.entriesCount < 10 { + if chatListView.0.entries.count < 10 { displaySearchFilters = false } diff --git a/submodules/ChatListUI/Sources/ChatListControllerNode.swift b/submodules/ChatListUI/Sources/ChatListControllerNode.swift index 223df354a4..b9d0a65c25 100644 --- a/submodules/ChatListUI/Sources/ChatListControllerNode.swift +++ b/submodules/ChatListUI/Sources/ChatListControllerNode.swift @@ -431,10 +431,6 @@ final class ChatListContainerNode: ASDisplayNode, UIGestureRecognizerDelegate { return self.currentItemNodeValue!.listNode } - var mainItemNode: ChatListNode { - return self.itemNodes[.all]!.listNode - } - private let currentItemStateValue = Promise<(state: ChatListNodeState, filterId: Int32?)>() var currentItemState: Signal<(state: ChatListNodeState, filterId: Int32?), NoError> { return self.currentItemStateValue.get()