Fix saved hashtags not getting persisted
This commit is contained in:
parent
514e569bd5
commit
1b917f6bed
|
@ -34,6 +34,13 @@ public class Hashtag: Codable {
|
|||
self.history = try container.decodeIfPresent([History].self, forKey: .history)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(name, forKey: .name)
|
||||
try container.encode(url.absoluteString, forKey: .url)
|
||||
try container.encodeIfPresent(history, forKey: .history)
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case name
|
||||
case url
|
||||
|
|
Loading…
Reference in New Issue