Fix using old style for show all statuses bar button item when showing a

conversation that initially expands all statuses
This commit is contained in:
Shadowfacts 2022-05-11 11:33:18 -04:00
parent 4a95ccccdb
commit 1a02319894
1 changed files with 7 additions and 2 deletions

View File

@ -122,8 +122,13 @@ class ConversationTableViewController: EnhancedTableViewController {
} }
}) })
let initialImage = showStatusesAutomatically ? ConversationTableViewController.hidePostsImage : ConversationTableViewController.showPostsImage if #available(iOS 15.0, *) {
visibilityBarButtonItem = UIBarButtonItem(image: initialImage, style: .plain, target: self, action: #selector(toggleVisibilityButtonPressed)) visibilityBarButtonItem = UIBarButtonItem(image: ConversationTableViewController.showPostsImage, style: .plain, target: self, action: #selector(toggleVisibilityButtonPressed))
visibilityBarButtonItem.isSelected = showStatusesAutomatically
} else {
let initialImage = showStatusesAutomatically ? ConversationTableViewController.hidePostsImage : ConversationTableViewController.showPostsImage
visibilityBarButtonItem = UIBarButtonItem(image: initialImage, style: .plain, target: self, action: #selector(toggleVisibilityButtonPressed))
}
navigationItem.rightBarButtonItem = visibilityBarButtonItem navigationItem.rightBarButtonItem = visibilityBarButtonItem
loadMainStatus() loadMainStatus()