Fix cell reuse bug with follow/action notifications

This commit is contained in:
Shadowfacts 2023-09-26 09:18:01 -04:00
parent a2fe0dfb78
commit 1b42cd7816
2 changed files with 4 additions and 4 deletions

View File

@ -155,8 +155,8 @@ class ActionNotificationGroupCollectionViewCell: UICollectionViewListCell {
}
imageView.update(for: avatarURL)
}
for imageView in avatarStack.arrangedSubviews.dropFirst(visibleAvatars.count) {
avatarStack.removeArrangedSubview(imageView)
while avatarStack.arrangedSubviews.count > visibleAvatars.count {
avatarStack.arrangedSubviews.last!.removeFromSuperview()
}
actionLabel.setEmojis(pairs: people.map { ($0.displayOrUserName, $0.emojis) }, identifier: group.id)

View File

@ -132,8 +132,8 @@ class FollowNotificationGroupCollectionViewCell: UICollectionViewListCell {
}
imageView.update(for: avatarURL)
}
for imageView in avatarStack.arrangedSubviews.dropFirst(visibleAvatars.count) {
avatarStack.removeArrangedSubview(imageView)
while avatarStack.arrangedSubviews.count > visibleAvatars.count {
avatarStack.arrangedSubviews.last!.removeFromSuperview()
}
}