From abd8fb2236248fecd136d8728c935976156b0ef4 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 15 Sep 2018 11:45:01 -0700 Subject: [PATCH] Store feed.name and feed.editedName in ODB. --- Frameworks/Account/Feed.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Frameworks/Account/Feed.swift b/Frameworks/Account/Feed.swift index 24172a8f2..1bea926c9 100644 --- a/Frameworks/Account/Feed.swift +++ b/Frameworks/Account/Feed.swift @@ -65,7 +65,19 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable { } } - public var name: String? + public var name: String? { + get { + return settingsTable.string(for: Key.name) + } + set { + let oldNameForDisplay = nameForDisplay + settingsTable.setString(newValue, for: Key.name) + if oldNameForDisplay != nameForDisplay { + postDisplayNameDidChangeNotification() + } + } + } + public var authors: Set? { get { guard let authorsJSON = settingsTable.string(for: Key.authors) else { @@ -167,8 +179,8 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable { let feedID = dictionary[Key.feedID] as? String ?? url self.init(account: account, url: url, feedID: feedID) - self.name = dictionary[Key.name] as? String self.editedName = dictionary[Key.editedName] as? String + self.name = dictionary[Key.name] as? String } public static func isFeedDictionary(_ d: [String: Any]) -> Bool {