From f93ac4ffdb7e6e19456c03effdedc13acec513b0 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 19 Jan 2026 20:34:23 -0800 Subject: [PATCH] Fix build errors. --- .../MainFeedCollectionHeaderReusableView.swift | 1 + .../MainFeedCollectionViewController.swift | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/iOS/MainFeed/Collection View Cells/MainFeedCollectionHeaderReusableView.swift b/iOS/MainFeed/Collection View Cells/MainFeedCollectionHeaderReusableView.swift index af88e7833..86d33375a 100644 --- a/iOS/MainFeed/Collection View Cells/MainFeedCollectionHeaderReusableView.swift +++ b/iOS/MainFeed/Collection View Cells/MainFeedCollectionHeaderReusableView.swift @@ -7,6 +7,7 @@ // import UIKit +import Account @MainActor protocol MainFeedCollectionHeaderReusableViewDelegate: AnyObject { func mainFeedCollectionHeaderReusableViewDidTapDisclosureIndicator(_ view: MainFeedCollectionHeaderReusableView) diff --git a/iOS/MainFeed/MainFeedCollectionViewController.swift b/iOS/MainFeed/MainFeedCollectionViewController.swift index e1c8a0c75..15c95c814 100644 --- a/iOS/MainFeed/MainFeedCollectionViewController.swift +++ b/iOS/MainFeed/MainFeedCollectionViewController.swift @@ -267,7 +267,7 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab let sectionID = self.dataSource.snapshot().sectionIdentifiers[indexPath.section] - // Smart feeds + // Smart feeds section if sectionID.isEmpty { headerView.headerTitle.text = SmartFeedsController.shared.nameForDisplay headerView.unreadCount = 0 @@ -277,11 +277,11 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab } // Accounts - guard let account = AccountManager.shared.existingAccount(withID: sectionID) else { + guard let account = AccountManager.shared.existingAccount(accountID: sectionID) else { return headerView } - headerView.headerTitle.text = account.displayName + headerView.headerTitle.text = account.nameForDisplay headerView.unreadCount = account.unreadCount headerView.account = account headerView.disclosureExpanded = self.coordinator.isExpanded(account) @@ -589,14 +589,10 @@ final class MainFeedCollectionViewController: UICollectionViewController, Undoab } private func findHeaderViewForAccount(_ account: Account) -> MainFeedCollectionHeaderReusableView? { - // Section identifiers are sidebarItemID strings. - guard let sectionID = account.sidebarItemID?.description else { + guard let sectionIndex = dataSource.snapshot().sectionIdentifiers.firstIndex(of: account.accountID) else { return nil } - guard let sectionIndex = snapshot.sectionIdentifiers.firstIndex(of: sectionID) else { - return nil - } - guard sectionIndex != 0 else { // Skip smart feeds. + guard sectionIndex > 0 else { // Skip smart feeds. return nil }