mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Comment improvements
This commit is contained in:
@@ -75,17 +75,15 @@ func rightNavigationButtonForChatInterfaceState(_ presentationInterfaceState: Ch
|
||||
}
|
||||
}
|
||||
|
||||
if case .replyThread = presentationInterfaceState.chatLocation {
|
||||
if case .search = currentButton?.action {
|
||||
return currentButton
|
||||
} else {
|
||||
let buttonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationCompactSearchIcon(presentationInterfaceState.theme), style: .plain, target: target, action: selector)
|
||||
buttonItem.accessibilityLabel = strings.Conversation_Search
|
||||
return ChatNavigationButton(action: .search, buttonItem: buttonItem)
|
||||
var hasMessages = false
|
||||
if let chatHistoryState = presentationInterfaceState.chatHistoryState {
|
||||
if case .loaded(false) = chatHistoryState {
|
||||
hasMessages = true
|
||||
}
|
||||
}
|
||||
if case let .peer(peerId) = presentationInterfaceState.chatLocation {
|
||||
if peerId.isReplies {
|
||||
|
||||
if case .replyThread = presentationInterfaceState.chatLocation {
|
||||
if hasMessages {
|
||||
if case .search = currentButton?.action {
|
||||
return currentButton
|
||||
} else {
|
||||
@@ -93,6 +91,23 @@ func rightNavigationButtonForChatInterfaceState(_ presentationInterfaceState: Ch
|
||||
buttonItem.accessibilityLabel = strings.Conversation_Search
|
||||
return ChatNavigationButton(action: .search, buttonItem: buttonItem)
|
||||
}
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
if case let .peer(peerId) = presentationInterfaceState.chatLocation {
|
||||
if peerId.isReplies {
|
||||
if hasMessages {
|
||||
if case .search = currentButton?.action {
|
||||
return currentButton
|
||||
} else {
|
||||
let buttonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationCompactSearchIcon(presentationInterfaceState.theme), style: .plain, target: target, action: selector)
|
||||
buttonItem.accessibilityLabel = strings.Conversation_Search
|
||||
return ChatNavigationButton(action: .search, buttonItem: buttonItem)
|
||||
}
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user