Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
fix: use pagination within LabelsViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
qkdreyer committed Mar 6, 2020
1 parent b23b509 commit 6ef1540
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Classes/Labels/GitHubClient+RepositoryLabels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ private extension FetchRepositoryLabelsQuery.Data {
}

func nextPageToken() -> String? {
guard repository?.refs?.pageInfo.hasNextPage == true else { return nil }
return repository?.refs?.pageInfo.endCursor
guard repository?.labels?.pageInfo.hasNextPage == true else { return nil }
return repository?.labels?.pageInfo.endCursor
}

}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Labels/LabelsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ LabelSectionControllerDelegate {
switch result {
case .success(let payload):
self?.labels = payload.labels.sorted { $0.name < $1.name }
strongSelf.update(animated: true)
strongSelf.update(page: payload.nextPage, animated: true)
case .error(let error):
Squawk.show(error: error)
}
Expand Down

0 comments on commit 6ef1540

Please sign in to comment.