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