Ensure that account metadata gets propagated to delegates when it reloads

This commit is contained in:
Maurice Parker 2019-09-23 09:57:50 -05:00
parent 0709b006f4
commit 6f9d3953f1
4 changed files with 5 additions and 4 deletions

View File

@ -174,7 +174,11 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
private lazy var opmlFile = OPMLFile(filename: (dataFolder as NSString).appendingPathComponent("Subscriptions.opml"), account: self) private lazy var opmlFile = OPMLFile(filename: (dataFolder as NSString).appendingPathComponent("Subscriptions.opml"), account: self)
private lazy var metadataFile = AccountMetadataFile(filename: (dataFolder as NSString).appendingPathComponent("Settings.plist"), account: self) private lazy var metadataFile = AccountMetadataFile(filename: (dataFolder as NSString).appendingPathComponent("Settings.plist"), account: self)
var metadata = AccountMetadata() var metadata = AccountMetadata() {
didSet {
delegate.accountMetadata = metadata
}
}
private lazy var feedMetadataFile = FeedMetadataFile(filename: (dataFolder as NSString).appendingPathComponent("FeedMetadata.plist"), account: self) private lazy var feedMetadataFile = FeedMetadataFile(filename: (dataFolder as NSString).appendingPathComponent("FeedMetadata.plist"), account: self)
typealias FeedMetadataDictionary = [String: FeedMetadata] typealias FeedMetadataDictionary = [String: FeedMetadata]

View File

@ -524,7 +524,6 @@ final class FeedbinAccountDelegate: AccountDelegate {
func accountDidInitialize(_ account: Account) { func accountDidInitialize(_ account: Account) {
credentials = try? account.retrieveCredentials(type: .basic) credentials = try? account.retrieveCredentials(type: .basic)
accountMetadata = account.metadata
} }
static func validateCredentials(transport: Transport, credentials: Credentials, endpoint: URL? = nil, completion: @escaping (Result<Credentials?, Error>) -> Void) { static func validateCredentials(transport: Transport, credentials: Credentials, endpoint: URL? = nil, completion: @escaping (Result<Credentials?, Error>) -> Void) {

View File

@ -170,7 +170,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
} }
func accountDidInitialize(_ account: Account) { func accountDidInitialize(_ account: Account) {
// accountMetadata = account.metadata
credentials = try? account.retrieveCredentials(type: .oauthAccessToken) credentials = try? account.retrieveCredentials(type: .oauthAccessToken)
syncStrategy = FeedlySyncStrategy(account: account, caller: caller, log: log) syncStrategy = FeedlySyncStrategy(account: account, caller: caller, log: log)

View File

@ -411,7 +411,6 @@ final class ReaderAPIAccountDelegate: AccountDelegate {
} }
func accountDidInitialize(_ account: Account) { func accountDidInitialize(_ account: Account) {
accountMetadata = account.metadata
credentials = try? account.retrieveCredentials(type: .readerAPIKey) credentials = try? account.retrieveCredentials(type: .readerAPIKey)
} }