fix: home timeline initial setup may get wrong content offset issue

This commit is contained in:
CMK 2021-07-09 13:17:25 +08:00
parent d350213f6c
commit 27cdc44532
1 changed files with 2 additions and 5 deletions

View File

@ -32,14 +32,11 @@ extension HomeTimelineViewModel {
timelineMiddleLoaderTableViewCellDelegate: timelineMiddleLoaderTableViewCellDelegate,
threadReplyLoaderTableViewCellDelegate: nil
)
// make initial snapshot animation smooth
var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>()
snapshot.appendSections([.main])
diffableDataSource?.apply(snapshot)
// workaround to append loader wrong animation issue
snapshot.appendItems([.bottomLoader], toSection: .main)
diffableDataSource?.apply(snapshot)
}
}