Merge branch 'main' of https://github.com/Ranchero-Software/NetNewsWire into main
This commit is contained in:
commit
8f346af250
|
@ -66,6 +66,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
||||||
public static let articles = "articles" // StatusesDidChange
|
public static let articles = "articles" // StatusesDidChange
|
||||||
public static let articleIDs = "articleIDs" // StatusesDidChange
|
public static let articleIDs = "articleIDs" // StatusesDidChange
|
||||||
public static let webFeeds = "webFeeds" // AccountDidDownloadArticles, StatusesDidChange
|
public static let webFeeds = "webFeeds" // AccountDidDownloadArticles, StatusesDidChange
|
||||||
|
public static let syncErrors = "syncErrors" // AccountsDidFailToSyncWithErrors
|
||||||
}
|
}
|
||||||
|
|
||||||
public static let defaultLocalAccountName: String = {
|
public static let defaultLocalAccountName: String = {
|
||||||
|
|
|
@ -267,7 +267,7 @@ public final class AccountManager: UnreadCountProvider {
|
||||||
|
|
||||||
group.notify(queue: DispatchQueue.main) {
|
group.notify(queue: DispatchQueue.main) {
|
||||||
if syncErrors.count > 0 {
|
if syncErrors.count > 0 {
|
||||||
NotificationCenter.default.post(Notification(name: .AccountsDidFailToSyncWithErrors, object: syncErrors, userInfo: nil))
|
NotificationCenter.default.post(Notification(name: .AccountsDidFailToSyncWithErrors, object: self, userInfo: [Account.UserInfoKey.syncErrors: syncErrors]))
|
||||||
}
|
}
|
||||||
completion?()
|
completion?()
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,10 +157,10 @@ private extension SceneModel {
|
||||||
func subscribeToAccountSyncErrors() {
|
func subscribeToAccountSyncErrors() {
|
||||||
NotificationCenter.default.publisher(for: .AccountsDidFailToSyncWithErrors)
|
NotificationCenter.default.publisher(for: .AccountsDidFailToSyncWithErrors)
|
||||||
.sink { [weak self] notification in
|
.sink { [weak self] notification in
|
||||||
guard let errors = notification.object as? [AccountSyncError] else {
|
guard let syncErrors = notification.userInfo?[Account.UserInfoKey.syncErrors] as? [AccountSyncError] else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self?.accountSyncErrors = errors
|
self?.accountSyncErrors = syncErrors
|
||||||
}.store(in: &cancellables)
|
}.store(in: &cancellables)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue