Note that AccountManager is main thread only. Add an assert in a strategic location (activeAccounts property).

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

View File

@ -10,6 +10,8 @@ import Foundation
import RSCore
import Articles
// Main thread only.
public extension Notification.Name {
static let AccountsDidChange = Notification.Name(rawValue: "AccountsDidChange")
}
@ -51,6 +53,7 @@ public final class AccountManager: UnreadCountProvider {
}
public var activeAccounts: [Account] {
assert(Thread.isMainThread)
return Array(accountsDictionary.values.filter { $0.isActive })
}