From 19eca0e3fc520ecd2a8f755911b83f10c70e79d5 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 21 Oct 2021 09:47:34 -0500 Subject: [PATCH] Restore the selection state after reloading cells --- iOS/MasterFeed/MasterFeedViewController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index 61afc6022..3bd93dcd7 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -122,6 +122,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner { guard let unreadCountNode = node, let indexPath = coordinator.indexPathFor(unreadCountNode) else { return } tableView.reloadRows(at: [indexPath], with: .none) + restoreSelectionIfNecessary(adjustScroll: false) } @objc func faviconDidBecomeAvailable(_ note: Notification) { @@ -866,6 +867,7 @@ private extension MasterFeedViewController { private func reloadAllVisibleCells(completion: (() -> Void)? = nil) { guard let indexPaths = tableView.indexPathsForVisibleRows else { return } tableView.reloadRows(at: indexPaths, with: .none) + restoreSelectionIfNecessary(adjustScroll: false) } private func accountForNode(_ node: Node) -> Account? {