Make sure delegates get set even if a metadata file isn't found. Issue #1051

This commit is contained in:
Maurice Parker 2019-09-24 06:56:39 -05:00
parent 026c7cfd6d
commit 46c737c777
2 changed files with 5 additions and 5 deletions

View File

@ -48,8 +48,8 @@ private extension AccountMetadataFile {
if let fileData = try? Data(contentsOf: readURL) {
let decoder = PropertyListDecoder()
account.metadata = (try? decoder.decode(AccountMetadata.self, from: fileData)) ?? AccountMetadata()
account.metadata.delegate = account
}
account.metadata.delegate = account
})
if let error = errorPointer?.pointee {

View File

@ -48,10 +48,10 @@ private extension FeedMetadataFile {
if let fileData = try? Data(contentsOf: readURL) {
let decoder = PropertyListDecoder()
account.feedMetadata = (try? decoder.decode(Account.FeedMetadataDictionary.self, from: fileData)) ?? Account.FeedMetadataDictionary()
account.feedMetadata.values.forEach { $0.delegate = account }
if !account.startingUp {
account.resetFeedMetadataAndUnreadCounts()
}
}
account.feedMetadata.values.forEach { $0.delegate = account }
if !account.startingUp {
account.resetFeedMetadataAndUnreadCounts()
}
})