Remove computed properties from TimelineItem
This commit is contained in:
parent
2a4a13ed13
commit
be60b112d0
|
@ -17,31 +17,25 @@ enum TimelineItemStatus {
|
||||||
|
|
||||||
struct TimelineItem: Identifiable {
|
struct TimelineItem: Identifiable {
|
||||||
|
|
||||||
|
var id: String
|
||||||
var article: Article
|
var article: Article
|
||||||
|
|
||||||
|
var status: TimelineItemStatus = .showNone
|
||||||
var truncatedTitle: String
|
var truncatedTitle: String
|
||||||
var truncatedSummary: String
|
var truncatedSummary: String
|
||||||
|
var byline: String
|
||||||
|
var dateTimeString: String
|
||||||
|
|
||||||
init(article: Article) {
|
init(article: Article) {
|
||||||
|
self.id = article.articleID
|
||||||
self.article = article
|
self.article = article
|
||||||
|
self.byline = article.webFeed?.nameForDisplay ?? ""
|
||||||
|
self.dateTimeString = ArticleStringFormatter.dateString(article.logicalDatePublished)
|
||||||
self.truncatedTitle = ArticleStringFormatter.truncatedTitle(article)
|
self.truncatedTitle = ArticleStringFormatter.truncatedTitle(article)
|
||||||
self.truncatedSummary = ArticleStringFormatter.truncatedSummary(article)
|
self.truncatedSummary = ArticleStringFormatter.truncatedSummary(article)
|
||||||
updateStatus()
|
updateStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
var id: String {
|
|
||||||
return article.articleID
|
|
||||||
}
|
|
||||||
|
|
||||||
var status: TimelineItemStatus = .showNone
|
|
||||||
|
|
||||||
var byline: String {
|
|
||||||
return article.webFeed?.nameForDisplay ?? ""
|
|
||||||
}
|
|
||||||
|
|
||||||
var dateTimeString: String {
|
|
||||||
return ArticleStringFormatter.dateString(article.logicalDatePublished)
|
|
||||||
}
|
|
||||||
|
|
||||||
mutating func updateStatus() {
|
mutating func updateStatus() {
|
||||||
if article.status.starred == true {
|
if article.status.starred == true {
|
||||||
status = .showStar
|
status = .showStar
|
||||||
|
|
Loading…
Reference in New Issue