mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Toolbar is in a much better shape.
This commit is contained in:
@@ -14,11 +14,7 @@ class AccountsPreferenceModel: ObservableObject {
|
||||
|
||||
|
||||
@Published var sortedAccounts: [Account] = []
|
||||
|
||||
// Configured Accounts
|
||||
@Published var selectedConfiguredAccountID: String? = nil
|
||||
|
||||
// Sheets
|
||||
@Published var showAddAccountView: Bool = false
|
||||
|
||||
var selectedAccountIsDefault: Bool {
|
||||
@@ -32,19 +28,19 @@ class AccountsPreferenceModel: ObservableObject {
|
||||
}
|
||||
|
||||
// Subscriptions
|
||||
var notifcationSubscriptions = Set<AnyCancellable>()
|
||||
var notificationSubscriptions = Set<AnyCancellable>()
|
||||
|
||||
init() {
|
||||
sortedAccounts = AccountManager.shared.sortedAccounts
|
||||
|
||||
NotificationCenter.default.publisher(for: .UserDidAddAccount).sink(receiveValue: { _ in
|
||||
self.sortedAccounts = AccountManager.shared.sortedAccounts
|
||||
}).store(in: ¬ifcationSubscriptions)
|
||||
}).store(in: ¬ificationSubscriptions)
|
||||
|
||||
NotificationCenter.default.publisher(for: .UserDidDeleteAccount).sink(receiveValue: { _ in
|
||||
self.selectedConfiguredAccountID = nil
|
||||
self.sortedAccounts = AccountManager.shared.sortedAccounts
|
||||
}).store(in: ¬ifcationSubscriptions)
|
||||
}).store(in: ¬ificationSubscriptions)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user