mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Implement active account processing functionality
This commit is contained in:
@@ -56,13 +56,13 @@ extension NSApplication : ScriptingObjectContainer {
|
||||
|
||||
@objc(accounts)
|
||||
func accounts() -> NSArray {
|
||||
let accounts = AccountManager.shared.accounts
|
||||
let accounts = AccountManager.shared.activeAccounts
|
||||
return accounts.map { ScriptableAccount($0) } as NSArray
|
||||
}
|
||||
|
||||
@objc(valueInAccountsWithUniqueID:)
|
||||
func valueInAccounts(withUniqueID id:String) -> ScriptableAccount? {
|
||||
let accounts = AccountManager.shared.accounts
|
||||
let accounts = AccountManager.shared.activeAccounts
|
||||
guard let account = accounts.first(where:{$0.accountID == id}) else { return nil }
|
||||
return ScriptableAccount(account)
|
||||
}
|
||||
@@ -74,7 +74,7 @@ extension NSApplication : ScriptingObjectContainer {
|
||||
*/
|
||||
|
||||
func allFeeds() -> [Feed] {
|
||||
let accounts = AccountManager.shared.accounts
|
||||
let accounts = AccountManager.shared.activeAccounts
|
||||
let emptyFeeds:[Feed] = []
|
||||
return accounts.reduce(emptyFeeds) { (result, nthAccount) -> [Feed] in
|
||||
let accountFeeds = Array(nthAccount.topLevelFeeds)
|
||||
|
||||
Reference in New Issue
Block a user