Various improvements

This commit is contained in:
Isaac
2024-01-30 15:32:44 +01:00
parent c92cc87162
commit d080951f11
6 changed files with 51 additions and 10 deletions

View File

@@ -398,7 +398,23 @@ func updateChatPresentationInterfaceStateImpl(
}
if updatedChatPresentationInterfaceState.displayHistoryFilterAsList {
if updatedChatPresentationInterfaceState.search?.resultsState == nil && updatedChatPresentationInterfaceState.historyFilter == nil && !selfController.alwaysShowSearchResultsAsList {
var canDisplayAsList = false
if updatedChatPresentationInterfaceState.search != nil {
if updatedChatPresentationInterfaceState.search?.resultsState != nil {
canDisplayAsList = true
}
if updatedChatPresentationInterfaceState.historyFilter != nil {
canDisplayAsList = true
}
if selfController.alwaysShowSearchResultsAsList {
canDisplayAsList = true
}
if case .peer(selfController.context.account.peerId) = updatedChatPresentationInterfaceState.chatLocation {
canDisplayAsList = true
}
}
if !canDisplayAsList {
updatedChatPresentationInterfaceState = updatedChatPresentationInterfaceState.updatedDisplayHistoryFilterAsList(false)
}
}