Make sure delegates get set even if a metadata file isn't found. Issue #1051
This commit is contained in:
parent
026c7cfd6d
commit
46c737c777
|
@ -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 {
|
||||
|
|
|
@ -48,11 +48,11 @@ 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()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if let error = errorPointer?.pointee {
|
||||
|
|
Loading…
Reference in New Issue