diff --git a/MobileFort/MobileFort/Common.swift b/MobileFort/MobileFort/Common.swift index ab4b036..1044280 100644 --- a/MobileFort/MobileFort/Common.swift +++ b/MobileFort/MobileFort/Common.swift @@ -14,6 +14,7 @@ struct OriginalPost: Decodable, Identifiable { let id: Int let title: String? + let content: String } struct Post: Decodable, Identifiable { @@ -43,6 +44,14 @@ struct Post: Decodable, Identifiable { return title } } + + func getContent() -> String { + if isReblogged() { + return originalPost!.content + } else { + return content + } + } } let mediaURL = "https://homepages.cae.wisc.edu/~ece533/images/airplane.png" diff --git a/MobileFort/MobileFort/PostView.swift b/MobileFort/MobileFort/PostView.swift index d32e302..a7107d6 100644 --- a/MobileFort/MobileFort/PostView.swift +++ b/MobileFort/MobileFort/PostView.swift @@ -52,6 +52,8 @@ struct PostView: View { } } } + + Text(post.getContent()) } }.frame(maxWidth: .infinity) }