mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix emoji status selection in chatlist
This commit is contained in:
parent
b77185fcb8
commit
8a2bcabfef
@ -844,7 +844,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
var selectedItems = Set<MediaId>()
|
||||
var topStatusTitle = self.presentationData.strings.PeerStatusSetup_NoTimerTitle
|
||||
var currentSelection: Int64?
|
||||
if let peerStatus = self.findTitleView()?.title.peerStatus, case let .emoji(emojiStatus) = peerStatus {
|
||||
if let emojiStatus = self.chatListHeaderView()?.emojiStatus() {
|
||||
selectedItems.insert(MediaId(namespace: Namespaces.Media.CloudFile, id: emojiStatus.fileId))
|
||||
currentSelection = emojiStatus.fileId
|
||||
|
||||
|
@ -1090,6 +1090,18 @@ public final class ChatListHeaderComponent: Component {
|
||||
public func findTitleView() -> ChatListTitleView? {
|
||||
return self.primaryContentView?.chatListTitleView
|
||||
}
|
||||
|
||||
public func emojiStatus() -> PeerEmojiStatus? {
|
||||
guard let component = self.component else {
|
||||
return nil
|
||||
}
|
||||
if let _ = component.storySubscriptions, let primaryContent = component.primaryContent, let chatListTitle = primaryContent.chatListTitle, let peerStatus = chatListTitle.peerStatus, case let .emoji(emojiStatus) = peerStatus {
|
||||
return emojiStatus
|
||||
} else if let peerStatus = self.findTitleView()?.title.peerStatus, case let .emoji(emojiStatus) = peerStatus {
|
||||
return emojiStatus
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
public func makeView() -> View {
|
||||
|
Loading…
x
Reference in New Issue
Block a user