From 79004130deb6c62905f20ba9b728aabc12255466 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Mon, 7 Nov 2022 22:15:05 -0800 Subject: [PATCH] Fix infinite reload --- Views/UIKit/Content Views/AnnouncementView.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Views/UIKit/Content Views/AnnouncementView.swift b/Views/UIKit/Content Views/AnnouncementView.swift index a074acd..e63ab6e 100644 --- a/Views/UIKit/Content Views/AnnouncementView.swift +++ b/Views/UIKit/Content Views/AnnouncementView.swift @@ -169,7 +169,12 @@ private extension AnnouncementView { snapshot.appendItems(viewModel.announcement.reactions, toSection: 0) 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() + } + } } } }