From f87ae3b315e20ac31426782d7f40f8977a36e5b9 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Mon, 8 Jan 2024 15:18:00 -0800 Subject: Add Markdown display for news articles to support rich text, images, links, tables, etc. --- Hotline/Models/NewsInfo.swift | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Hotline/Models') diff --git a/Hotline/Models/NewsInfo.swift b/Hotline/Models/NewsInfo.swift index daab71f..f95cba1 100644 --- a/Hotline/Models/NewsInfo.swift +++ b/Hotline/Models/NewsInfo.swift @@ -15,6 +15,7 @@ enum NewsInfoType { let categoryID: UUID? let articleID: UInt? + let parentID: UInt? let path: [String] var expanded: Bool = false @@ -27,6 +28,7 @@ enum NewsInfoType { init(hotlineNewsCategory: HotlineNewsCategory) { self.categoryID = hotlineNewsCategory.id self.articleID = nil + self.parentID = nil self.name = hotlineNewsCategory.name self.count = UInt(hotlineNewsCategory.count) self.path = hotlineNewsCategory.path @@ -41,6 +43,8 @@ enum NewsInfoType { init(hotlineNewsArticle: HotlineNewsArticle) { self.articleID = UInt(hotlineNewsArticle.id) + self.parentID = hotlineNewsArticle.parentID == 0 ? nil : UInt(hotlineNewsArticle.parentID) + print(hotlineNewsArticle.parentID) self.categoryID = nil self.name = hotlineNewsArticle.title self.count = 0 -- cgit