Additional topic fixes

This commit is contained in:
Isaac 2026-02-13 19:19:48 +04:00
parent 6c37615dbd
commit 631d5e1b2f
2 changed files with 14 additions and 0 deletions

View file

@ -406,6 +406,14 @@ public final class ChatTopicsHeaderPanelComponent: Component {
return size
}
public func topicIndex(threadId: Int64?) -> Int? {
if let panelView = self.panel.view as? ChatSideTopicsPanel.View {
return panelView.topicIndex(threadId: threadId)
} else {
return nil
}
}
}
public func makeView() -> View {

View file

@ -5058,6 +5058,12 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
leftIndex = floatingTopicsPanelView.topicIndex(threadId: fromLocation)
rightIndex = floatingTopicsPanelView.topicIndex(threadId: toLocation)
}
if leftIndex == nil || rightIndex == nil {
if let headerPanelsComponentView = self.headerPanelsView?.view as? HeaderPanelContainerComponent.View, let topicsPanelView = headerPanelsComponentView.panel(forKey: AnyHashable("topics")) as? ChatTopicsHeaderPanelComponent.View {
leftIndex = topicsPanelView.topicIndex(threadId: fromLocation)
rightIndex = topicsPanelView.topicIndex(threadId: toLocation)
}
}
guard let leftIndex, let rightIndex else {
return nil
}