Fix a couple first-run startup bugs.
This commit is contained in:
parent
b597387e1a
commit
d69058c10c
|
@ -672,7 +672,9 @@ private extension Account {
|
||||||
do {
|
do {
|
||||||
fileData = try Data(contentsOf: opmlFileURL)
|
fileData = try Data(contentsOf: opmlFileURL)
|
||||||
} catch {
|
} catch {
|
||||||
NSApplication.shared.presentError(error)
|
// Commented out because it’s not an error on first run.
|
||||||
|
// TODO: make it so we know if it’s first run or not.
|
||||||
|
//NSApplication.shared.presentError(error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
guard let opmlData = fileData else {
|
guard let opmlData = fileData else {
|
||||||
|
@ -811,6 +813,8 @@ private extension Account {
|
||||||
database.fetchAllNonZeroUnreadCounts { (unreadCountDictionary) in
|
database.fetchAllNonZeroUnreadCounts { (unreadCountDictionary) in
|
||||||
|
|
||||||
if unreadCountDictionary.isEmpty {
|
if unreadCountDictionary.isEmpty {
|
||||||
|
self.fetchingAllUnreadCounts = false
|
||||||
|
self.updateUnreadCount()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,13 +45,9 @@ struct FeedsImporter {
|
||||||
let feedsToImport = feeds(with: feedDictionaries, account: account)
|
let feedsToImport = feeds(with: feedDictionaries, account: account)
|
||||||
|
|
||||||
BatchUpdate.shared.perform {
|
BatchUpdate.shared.perform {
|
||||||
for feed in feedsToImport {
|
feedsToImport.forEach{ account.addFeed($0, to: nil) }
|
||||||
if !account.hasFeed(with: feed.feedID) {
|
|
||||||
account.addFeed(feed, to: nil)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
account.dirty = true
|
account.structureDidChange()
|
||||||
}
|
}
|
||||||
|
|
||||||
private static func feeds(with feedDictionaries: [DiskFeedDictionary], account: Account) -> Set<Feed> {
|
private static func feeds(with feedDictionaries: [DiskFeedDictionary], account: Account) -> Set<Feed> {
|
||||||
|
|
Loading…
Reference in New Issue