Fix infinite reload

This commit is contained in:
Justin Mazzocchi 2022-11-07 22:15:05 -08:00
parent 86b6fffc7c
commit 79004130de

View file

@ -169,7 +169,12 @@ private extension AnnouncementView {
snapshot.appendItems(viewModel.announcement.reactions, toSection: 0) snapshot.appendItems(viewModel.announcement.reactions, toSection: 0)
if snapshot.itemIdentifiers != dataSource.snapshot().itemIdentifiers { if snapshot.itemIdentifiers != dataSource.snapshot().itemIdentifiers {
dataSource.apply(snapshot, animatingDifferences: false) { viewModel.reload() } dataSource.apply(snapshot, animatingDifferences: false) {
if self.contentTextView.frame.size == .zero
|| self.contentTextView.contentSize.height < self.contentTextView.frame.height {
viewModel.reload()
}
}
} }
} }
} }