From 1e82ad48451a2971e6e425cbc4f07c56b7142f91 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 7 Jul 2019 14:05:27 -0700 Subject: [PATCH] Note that AccountManager is main thread only. Add an assert in a strategic location (activeAccounts property). --- Frameworks/Account/AccountManager.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Frameworks/Account/AccountManager.swift b/Frameworks/Account/AccountManager.swift index efe7305f0..acb53cd5b 100644 --- a/Frameworks/Account/AccountManager.swift +++ b/Frameworks/Account/AccountManager.swift @@ -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 }) }