1
Fork 0

Show post's content in post view

This commit is contained in:
redstrate 2020-06-04 06:07:18 -04:00
parent 9e25686cd6
commit 2bf082f2f9
2 changed files with 11 additions and 0 deletions

View file

@ -14,6 +14,7 @@ struct OriginalPost: Decodable, Identifiable {
let id: Int let id: Int
let title: String? let title: String?
let content: String
} }
struct Post: Decodable, Identifiable { struct Post: Decodable, Identifiable {
@ -43,6 +44,14 @@ struct Post: Decodable, Identifiable {
return title return title
} }
} }
func getContent() -> String {
if isReblogged() {
return originalPost!.content
} else {
return content
}
}
} }
let mediaURL = "https://homepages.cae.wisc.edu/~ece533/images/airplane.png" let mediaURL = "https://homepages.cae.wisc.edu/~ece533/images/airplane.png"

View file

@ -52,6 +52,8 @@ struct PostView: View {
} }
} }
} }
Text(post.getContent())
} }
}.frame(maxWidth: .infinity) }.frame(maxWidth: .infinity)
} }