mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
removed some unnecessary print()
This commit is contained in:
parent
807c0a1e2e
commit
ae16680fc2
@ -47,23 +47,16 @@ final class CommentsModel: ObservableObject {
|
|||||||
self.all += commentsPage.comments
|
self.all += commentsPage.comments
|
||||||
self.nextPage = commentsPage.nextPage
|
self.nextPage = commentsPage.nextPage
|
||||||
self.disabled = commentsPage.disabled
|
self.disabled = commentsPage.disabled
|
||||||
} else {
|
|
||||||
print("Failed to parse response: \(response)")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onFailure { [weak self] error in
|
.onFailure { [weak self] _ in
|
||||||
self?.handleFailure(error: error)
|
self?.disabled = true
|
||||||
}
|
}
|
||||||
.onCompletion { [weak self] _ in
|
.onCompletion { [weak self] _ in
|
||||||
self?.loaded = true
|
self?.loaded = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleFailure(error: Error) {
|
|
||||||
disabled = true
|
|
||||||
print("Encountered an error: \(error)")
|
|
||||||
}
|
|
||||||
|
|
||||||
func loadNextPageIfNeeded(current comment: Comment) {
|
func loadNextPageIfNeeded(current comment: Comment) {
|
||||||
let thresholdIndex = all.index(all.endIndex, offsetBy: -5)
|
let thresholdIndex = all.index(all.endIndex, offsetBy: -5)
|
||||||
if all.firstIndex(where: { $0 == comment }) == thresholdIndex {
|
if all.firstIndex(where: { $0 == comment }) == thresholdIndex {
|
||||||
|
Loading…
Reference in New Issue
Block a user