Display "(No Text)" if there isn't a title or summary for the timeline. Fixes #2391
This commit is contained in:
parent
d735ae91dc
commit
0a01a9f501
@ -11,6 +11,8 @@ import Articles
|
||||
|
||||
struct TimelineCellData {
|
||||
|
||||
private static let noText = NSLocalizedString("(No Text)", comment: "No Text")
|
||||
|
||||
let title: String
|
||||
let attributedTitle: NSAttributedString
|
||||
let text: String
|
||||
@ -28,8 +30,14 @@ struct TimelineCellData {
|
||||
|
||||
self.title = ArticleStringFormatter.truncatedTitle(article)
|
||||
self.attributedTitle = ArticleStringFormatter.attributedTruncatedTitle(article)
|
||||
self.text = ArticleStringFormatter.truncatedSummary(article)
|
||||
|
||||
let truncatedSummary = ArticleStringFormatter.truncatedSummary(article)
|
||||
if self.title.isEmpty && truncatedSummary.isEmpty {
|
||||
self.text = Self.noText
|
||||
} else {
|
||||
self.text = truncatedSummary
|
||||
}
|
||||
|
||||
self.dateString = ArticleStringFormatter.dateString(article.logicalDatePublished)
|
||||
|
||||
if let feedName = feedName {
|
||||
|
@ -10,6 +10,8 @@ import UIKit
|
||||
import Articles
|
||||
|
||||
struct MasterTimelineCellData {
|
||||
|
||||
private static let noText = NSLocalizedString("(No Text)", comment: "No Text")
|
||||
|
||||
let title: String
|
||||
let attributedTitle: NSAttributedString
|
||||
@ -30,8 +32,14 @@ struct MasterTimelineCellData {
|
||||
|
||||
self.title = ArticleStringFormatter.truncatedTitle(article)
|
||||
self.attributedTitle = ArticleStringFormatter.attributedTruncatedTitle(article)
|
||||
self.summary = ArticleStringFormatter.truncatedSummary(article)
|
||||
|
||||
let truncatedSummary = ArticleStringFormatter.truncatedSummary(article)
|
||||
if self.title.isEmpty && truncatedSummary.isEmpty {
|
||||
self.summary = Self.noText
|
||||
} else {
|
||||
self.summary = truncatedSummary
|
||||
}
|
||||
|
||||
self.dateString = ArticleStringFormatter.dateString(article.logicalDatePublished)
|
||||
|
||||
if let feedName = feedName {
|
||||
|
Loading…
x
Reference in New Issue
Block a user