From 2bef030b37f3453ff64efb631ee4b099d0ca4c2d Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Tue, 6 Jan 2026 15:16:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Fix=20unread=20count=20animation?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainFeedCollectionViewFolderCell.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iOS/MainFeed/Collection View Cells/MainFeedCollectionViewFolderCell.swift b/iOS/MainFeed/Collection View Cells/MainFeedCollectionViewFolderCell.swift index 2e5d8bab7..daef20215 100644 --- a/iOS/MainFeed/Collection View Cells/MainFeedCollectionViewFolderCell.swift +++ b/iOS/MainFeed/Collection View Cells/MainFeedCollectionViewFolderCell.swift @@ -31,7 +31,7 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell { unreadCountLabel.isHidden = true } else { unreadCountLabel.isHidden = false - updateUnreadCount() + updateUnreadCountVisibility() } unreadCountLabel.text = newValue.formatted() } @@ -51,7 +51,7 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell { var disclosureExpanded = true { didSet { updateExpandedState(animate: true) - updateUnreadCount() + updateUnreadCountVisibility() } } @@ -75,13 +75,13 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell { } } - func updateUnreadCount() { - if !disclosureExpanded && unreadCount > 0 && unreadCountLabel.alpha != 1 { - UIView.animate(withDuration: 0.3) { + func updateUnreadCountVisibility() { + if !disclosureExpanded && unreadCount > 0 { + UIView.animate { self.unreadCountLabel.alpha = 1 } } else { - UIView.animate(withDuration: 0.3) { + UIView.animate { self.unreadCountLabel.alpha = 0 } }