Add comment that Account is main-thread-only, and assert that we’re on the main thread in flattenedFeeds().

This commit is contained in:
Brent Simmons 2019-07-07 14:01:44 -07:00
parent daaf44d67f
commit 590961fb2c
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,8 @@ import RSParser
import ArticlesDatabase
import RSWeb
// Main thread only.
public extension Notification.Name {
static let AccountRefreshDidBegin = Notification.Name(rawValue: "AccountRefreshDidBegin")
static let AccountRefreshDidFinish = Notification.Name(rawValue: "AccountRefreshDidFinish")
@ -636,6 +638,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
// MARK: - Container
public func flattenedFeeds() -> Set<Feed> {
assert(Thread.isMainThread)
if flattenedFeedsNeedUpdate {
updateFlattenedFeeds()
}