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) {
|
if let fileData = try? Data(contentsOf: readURL) {
|
||||||
let decoder = PropertyListDecoder()
|
let decoder = PropertyListDecoder()
|
||||||
account.metadata = (try? decoder.decode(AccountMetadata.self, from: fileData)) ?? AccountMetadata()
|
account.metadata = (try? decoder.decode(AccountMetadata.self, from: fileData)) ?? AccountMetadata()
|
||||||
account.metadata.delegate = account
|
|
||||||
}
|
}
|
||||||
|
account.metadata.delegate = account
|
||||||
})
|
})
|
||||||
|
|
||||||
if let error = errorPointer?.pointee {
|
if let error = errorPointer?.pointee {
|
||||||
|
@ -48,10 +48,10 @@ private extension FeedMetadataFile {
|
|||||||
if let fileData = try? Data(contentsOf: readURL) {
|
if let fileData = try? Data(contentsOf: readURL) {
|
||||||
let decoder = PropertyListDecoder()
|
let decoder = PropertyListDecoder()
|
||||||
account.feedMetadata = (try? decoder.decode(Account.FeedMetadataDictionary.self, from: fileData)) ?? Account.FeedMetadataDictionary()
|
account.feedMetadata = (try? decoder.decode(Account.FeedMetadataDictionary.self, from: fileData)) ?? Account.FeedMetadataDictionary()
|
||||||
account.feedMetadata.values.forEach { $0.delegate = account }
|
}
|
||||||
if !account.startingUp {
|
account.feedMetadata.values.forEach { $0.delegate = account }
|
||||||
account.resetFeedMetadataAndUnreadCounts()
|
if !account.startingUp {
|
||||||
}
|
account.resetFeedMetadataAndUnreadCounts()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user