From 40ea5243c6e75ab6c0dc9c5fc7237a280673dcca Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 1 Apr 2020 20:31:32 -0500 Subject: [PATCH] Removed notification we no longer needed to use to refresh the Feeds and Sidebar. --- Frameworks/Account/Account.swift | 5 +---- Mac/MainWindow/Sidebar/SidebarViewController.swift | 5 ----- iOS/SceneCoordinator.swift | 5 ----- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index 64a872d49..93c78b199 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -27,7 +27,6 @@ public extension Notification.Name { static let AccountRefreshDidBegin = Notification.Name(rawValue: "AccountRefreshDidBegin") static let AccountRefreshDidFinish = Notification.Name(rawValue: "AccountRefreshDidFinish") static let AccountRefreshProgressDidChange = Notification.Name(rawValue: "AccountRefreshProgressDidChange") - static let DownloadArticlesDidUpdateUnreadCounts = Notification.Name(rawValue: "DownloadArticlesDidUpdateUnreadCounts") static let AccountDidDownloadArticles = Notification.Name(rawValue: "AccountDidDownloadArticles") static let AccountStateDidChange = Notification.Name(rawValue: "AccountStateDidChange") static let StatusesDidChange = Notification.Name(rawValue: "StatusesDidChange") @@ -1289,9 +1288,7 @@ private extension Account { if let newArticles = newAndUpdatedArticles.newArticles, !newArticles.isEmpty { shouldSendNotification = true userInfo[UserInfoKey.newArticles] = newArticles - self.updateUnreadCounts(for: webFeeds) { - NotificationCenter.default.post(name: .DownloadArticlesDidUpdateUnreadCounts, object: self, userInfo: nil) - } + self.updateUnreadCounts(for: webFeeds) } if let updatedArticles = newAndUpdatedArticles.updatedArticles, !updatedArticles.isEmpty { diff --git a/Mac/MainWindow/Sidebar/SidebarViewController.swift b/Mac/MainWindow/Sidebar/SidebarViewController.swift index 5ffe5ae31..e7cde17b1 100644 --- a/Mac/MainWindow/Sidebar/SidebarViewController.swift +++ b/Mac/MainWindow/Sidebar/SidebarViewController.swift @@ -75,7 +75,6 @@ protocol SidebarDelegate: class { NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(webFeedSettingDidChange(_:)), name: .WebFeedSettingDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange(_:)), name: .DisplayNameDidChange, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(downloadArticlesDidUpdateUnreadCounts(_:)), name: .DownloadArticlesDidUpdateUnreadCounts, object: nil) outlineView.reloadData() @@ -218,10 +217,6 @@ protocol SidebarDelegate: class { revealAndSelectRepresentedObject(feed as AnyObject) } - @objc func downloadArticlesDidUpdateUnreadCounts(_ note: Notification) { - rebuildTreeAndRestoreSelection() - } - // MARK: - Actions @IBAction func delete(_ sender: AnyObject?) { diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 0929f16c4..63aa7f138 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -301,7 +301,6 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider { NotificationCenter.default.addObserver(self, selector: #selector(userDidDeleteAccount(_:)), name: .UserDidDeleteAccount, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(userDidAddFeed(_:)), name: .UserDidAddFeed, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(downloadArticlesDidUpdateUnreadCounts(_:)), name: .DownloadArticlesDidUpdateUnreadCounts, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(accountDidDownloadArticles(_:)), name: .AccountDidDownloadArticles, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil) @@ -535,10 +534,6 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider { self.groupByFeed = AppDefaults.timelineGroupByFeed } - @objc func downloadArticlesDidUpdateUnreadCounts(_ note: Notification) { - rebuildBackingStores() - } - @objc func accountDidDownloadArticles(_ note: Notification) { guard let feeds = note.userInfo?[Account.UserInfoKey.webFeeds] as? Set else { return