[WIP] Monoforums

This commit is contained in:
Isaac
2025-05-14 00:50:46 +08:00
parent 9e18743b1b
commit f90402102b
36 changed files with 1191 additions and 340 deletions

View File

@@ -239,6 +239,7 @@ public final class ChatSideTopicsPanel: Component {
avatarNode = current
} else {
avatarNode = AvatarNode(font: avatarPlaceholderFont(size: 11.0))
avatarNode.isUserInteractionEnabled = false
self.avatarNode = avatarNode
self.containerButton.addSubview(avatarNode.view)
}
@@ -597,6 +598,18 @@ public final class ChatSideTopicsPanel: Component {
}
}
public func topicIndex(threadId: Int64?) -> Int? {
if let threadId {
if let value = self.items.firstIndex(where: { $0.id == .chatList(PeerId(threadId)) }) {
return value + 1
} else {
return nil
}
} else {
return 0
}
}
func update(component: ChatSideTopicsPanel, availableSize: CGSize, state: EmptyComponentState, environment: Environment<EnvironmentType>, transition: ComponentTransition) -> CGSize {
self.isUpdating = true
defer {