Use short descriptions in instance selector when available
This commit is contained in:
parent
b755607895
commit
c7e39cb041
|
@ -12,6 +12,7 @@ public class Instance: Decodable {
|
|||
public let uri: String
|
||||
public let title: String
|
||||
public let description: String
|
||||
public let shortDescription: String?
|
||||
public let email: String?
|
||||
public let version: String
|
||||
public let urls: [String: URL]
|
||||
|
@ -40,6 +41,7 @@ public class Instance: Decodable {
|
|||
self.uri = try container.decode(String.self, forKey: .uri)
|
||||
self.title = try container.decode(String.self, forKey: .title)
|
||||
self.description = try container.decode(String.self, forKey: .description)
|
||||
self.shortDescription = try container.decodeIfPresent(String.self, forKey: .shortDescription)
|
||||
self.email = try container.decodeIfPresent(String.self, forKey: .email)
|
||||
self.version = try container.decode(String.self, forKey: .version)
|
||||
if let urls = try? container.decodeIfPresent([String: URL].self, forKey: .urls) {
|
||||
|
@ -72,6 +74,7 @@ public class Instance: Decodable {
|
|||
case uri
|
||||
case title
|
||||
case description
|
||||
case shortDescription = "short_description"
|
||||
case email
|
||||
case version
|
||||
case urls
|
||||
|
|
|
@ -48,7 +48,7 @@ class InstanceTableViewCell: UITableViewCell {
|
|||
|
||||
domainLabel.text = URLComponents(string: instance.uri)?.host ?? instance.uri
|
||||
adultLabel.isHidden = true
|
||||
descriptionTextView.setTextFromHtml(instance.description)
|
||||
descriptionTextView.setTextFromHtml(instance.shortDescription ?? instance.description)
|
||||
|
||||
if let thumbnail = instance.thumbnail {
|
||||
updateThumbnail(url: thumbnail)
|
||||
|
|
Loading…
Reference in New Issue