Ensure that account metadata gets propagated to delegates when it reloads
This commit is contained in:
parent
0709b006f4
commit
6f9d3953f1
|
@ -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]
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue