diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index b40c2076f7..1b343078f6 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -160,7 +160,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - pruneOffscreenRows() +// pruneOffscreenRows() } private func removeTimelineDescriptionCell() { @@ -170,27 +170,28 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro isShowingTimelineDescription = false } - private func pruneOffscreenRows() { - guard let lastVisibleIndexPath = collectionView.indexPathsForVisibleItems.last else { - return - } - var snapshot = dataSource.snapshot() - guard snapshot.indexOfSection(.statuses) != nil else { - return - } - let items = snapshot.itemIdentifiers(inSection: .statuses) - let pageSize = 20 - let numberOfPagesToPrune = (items.count - lastVisibleIndexPath.row - 1) / pageSize - if numberOfPagesToPrune > 0 { - let itemsToRemove = Array(items.suffix(numberOfPagesToPrune * pageSize)) - snapshot.deleteItems(itemsToRemove) - } - dataSource.apply(snapshot, animatingDifferences: false) - - if case .status(id: let id, state: _) = snapshot.itemIdentifiers(inSection: .statuses).last { - older = .before(id: id, count: nil) - } - } +// private func pruneOffscreenRows() { +// guard let lastVisibleIndexPath = collectionView.indexPathsForVisibleItems.last else { +// return +// } +// var snapshot = dataSource.snapshot() +// guard snapshot.indexOfSection(.statuses) != nil else { +// return +// } +// let items = snapshot.itemIdentifiers(inSection: .statuses) +// let pageSize = 20 +// let numberOfPagesToPrune = (items.count - lastVisibleIndexPath.row - 1) / pageSize +// if numberOfPagesToPrune > 0 { +// let itemsToRemove = Array(items.suffix(numberOfPagesToPrune * pageSize)) +// snapshot.deleteItems(itemsToRemove) +// +// dataSource.apply(snapshot, animatingDifferences: false) +// +// if case .status(id: let id, state: _) = snapshot.itemIdentifiers(inSection: .statuses).last { +// older = .before(id: id, count: nil) +// } +// } +// } @objc func refresh() { Task {