mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user