diff --git a/Tusker/Screens/Conversation/ConversationTableViewController.swift b/Tusker/Screens/Conversation/ConversationTableViewController.swift index 93a4f14677..c14311f97b 100644 --- a/Tusker/Screens/Conversation/ConversationTableViewController.swift +++ b/Tusker/Screens/Conversation/ConversationTableViewController.swift @@ -133,13 +133,15 @@ class ConversationTableViewController: EnhancedTableViewController { @objc func toggleVisibilityButtonPressed() { showStatusesAutomatically = !showStatusesAutomatically + for (_, state) in statuses where state.collapsible == true { + state.collapsed = !showStatusesAutomatically + } + for cell in tableView.visibleCells { guard let cell = cell as? BaseStatusTableViewCell, cell.collapsible else { continue } cell.showStatusAutomatically = showStatusesAutomatically cell.setCollapsed(!showStatusesAutomatically, animated: false) - let indexPath = tableView.indexPath(for: cell)! - statuses[indexPath.row].state.collapsed = !showStatusesAutomatically } // recalculate cell heights