diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index ad44ac38..376fab48 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -348,9 +348,13 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro config.action = { [unowned self] toast in toast.dismissToast(animated: true) - self.dataSource.apply(snapshot, animatingDifferences: false) - - self.collectionView.scrollToTop() + self.dataSource.apply(snapshot, animatingDifferences: true) { + // TODO: we can't set prevScrollOffsetBeforeScrollToTop here to allow undoing the scroll-to-top + // because that would involve scrolling through unmeasured-cell which fucks up the content offset values. + // we probably need a data-source aware implementation of scrollToTop which uses item & offset w/in item + // to track the restore position + self.collectionView.scrollToItem(at: IndexPath(row: 0, section: 0), at: .top, animated: true) + } } self.showToast(configuration: config, animated: true) }