gets rid of unneccessary tracking

This commit is contained in:
Stuart Breckenridge
2022-02-11 07:45:32 +08:00
parent e67136f026
commit d71884a106

View File

@@ -33,7 +33,6 @@ class NotificationsViewController: UIViewController {
}
}
private var filterButton: UIBarButtonItem!
private var prefetchedIndexPaths = Set<IndexPath>()
override func viewDidLoad() {
super.viewDidLoad()
@@ -74,20 +73,16 @@ class NotificationsViewController: UIViewController {
@objc
private func updateCellsFrom(_ notification: Notification) {
guard let webFeed = notification.userInfo?[UserInfoKey.webFeed] as? WebFeed else { return }
if let visibleIndexPaths = notificationsTableView.indexPathsForVisibleRows {
for path in visibleIndexPaths {
if let cell = notificationsTableView.cellForRow(at: path) as? NotificationsTableViewCell {
if cell.feed! == webFeed {
notificationsTableView.reconfigureRows(at: [path])
return
}
}
}
}
}
@objc
@@ -228,19 +223,16 @@ extension NotificationsViewController: UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: "NotificationsCell") as! NotificationsTableViewCell
let account = AccountManager.shared.sortedActiveAccounts[indexPath.section - 1]
cell.configure(filteredWebFeeds(searchController.searchBar.text, account: account)[indexPath.row])
prefetchedIndexPaths.insert(indexPath)
return cell
} else if newArticleNotificationFilter == true {
let cell = tableView.dequeueReusableCell(withIdentifier: "NotificationsCell") as! NotificationsTableViewCell
let account = AccountManager.shared.sortedActiveAccounts[indexPath.section - 1]
cell.configure(feedsWithNotificationsEnabled(account)[indexPath.row])
prefetchedIndexPaths.insert(indexPath)
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: "NotificationsCell") as! NotificationsTableViewCell
let account = AccountManager.shared.sortedActiveAccounts[indexPath.section - 1]
cell.configure(sortedWebFeedsForAccount(account)[indexPath.row])
prefetchedIndexPaths.insert(indexPath)
return cell
}
}