From 7140590ccfe2bc5a536c0718dcc2a37d38b9513b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 28 Nov 2019 18:58:47 -0500 Subject: [PATCH] Fix covnerstaion expand/collapse button not working on all statuses --- .../Conversation/ConversationTableViewController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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