Comments improvements

* Show text when there is no comments or comments are disabled
* Show progress indicator for loading comments/replies
* Improve layout of icons and text spacing
This commit is contained in:
Arkadiusz Fal
2021-12-05 18:14:49 +01:00
parent 37b99c59e1
commit 1f495562fc
7 changed files with 142 additions and 52 deletions

View File

@@ -72,10 +72,12 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
}
configureTransformer(pathPattern("comments/*")) { (content: Entity<JSON>) -> CommentsPage in
let comments = content.json.dictionaryValue["comments"]?.arrayValue.map { PipedAPI.extractComment(from: $0)! } ?? []
let nextPage = content.json.dictionaryValue["nextpage"]?.stringValue
let details = content.json.dictionaryValue
let comments = details["comments"]?.arrayValue.map { PipedAPI.extractComment(from: $0)! } ?? []
let nextPage = details["nextpage"]?.stringValue
let disabled = details["disabled"]?.boolValue ?? false
return CommentsPage(comments: comments, nextPage: nextPage)
return CommentsPage(comments: comments, nextPage: nextPage, disabled: disabled)
}
if account.token.isNil {