mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-08 19:10:53 +00:00
Fix search activation
This commit is contained in:
parent
6789c8b486
commit
9b87791908
@ -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
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user