diff options
Diffstat (limited to 'Hotline/Models')
| -rw-r--r-- | Hotline/Models/Hotline.swift | 1 | ||||
| -rw-r--r-- | Hotline/Models/NewsInfo.swift | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Hotline/Models/Hotline.swift b/Hotline/Models/Hotline.swift index 48266a9..5dc61ab 100644 --- a/Hotline/Models/Hotline.swift +++ b/Hotline/Models/Hotline.swift @@ -387,6 +387,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { if let parentID = article.parentID, parentID != 0, let parentArticle = articleMap[parentID] { + article.expanded = true parentArticle.children.append(article) } else { diff --git a/Hotline/Models/NewsInfo.swift b/Hotline/Models/NewsInfo.swift index b635138..eecd550 100644 --- a/Hotline/Models/NewsInfo.swift +++ b/Hotline/Models/NewsInfo.swift @@ -26,6 +26,10 @@ enum NewsInfoType { var articleDate: Date? var read: Bool = false + var expandable: Bool { + self.type == .bundle || self.type == .category || self.children.count > 0 + } + init(hotlineNewsCategory: HotlineNewsCategory) { self.categoryID = hotlineNewsCategory.id self.articleID = nil |