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

Commit 24e18bb

Browse files
committed
cleans up issue labels query
1 parent eced1f0 commit 24e18bb

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Classes/Issues/IssuesViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ final class IssuesViewController: MessageViewController,
5454
private var needsScrollToBottom = false
5555
private var lastTimelineElement: ListDiffable?
5656
private var actions: IssueTextActionsView?
57+
private var issueType: RepositoryIssuesType?
5758

5859
// must fetch collaborator info from API before showing editing controls
5960
private var viewerIsCollaborator = false
@@ -333,6 +334,7 @@ final class IssuesViewController: MessageViewController,
333334
)
334335
strongSelf.client.cache.add(listener: strongSelf, value: result)
335336
strongSelf.resultID = result.id
337+
strongSelf.issueType = result.pullRequest ? .pullRequests : .issues
336338
default: break
337339
}
338340

@@ -636,7 +638,8 @@ final class IssuesViewController: MessageViewController,
636638
// MARK: IssueLabelsSectionControllerDelegate
637639

638640
func didTapIssueLabel(owner: String, repo: String, label: String) {
639-
presentLabels(client: client, owner: owner, repo: repo, label: label)
641+
guard let issueType = self.issueType else { return }
642+
presentLabels(client: client, owner: owner, repo: repo, label: label, type: issueType)
640643
}
641644

642645
}

Classes/View Controllers/UIViewController+PresentLabels.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import UIKit
1010
import GitHubAPI
1111

1212
extension UIViewController {
13-
func presentLabels(client: GithubClient, owner: String, repo: String, label: String) {
13+
func presentLabels(client: GithubClient, owner: String, repo: String, label: String, type: RepositoryIssuesType) {
1414
let repositoryIssuesViewController =
1515
RepositoryIssuesViewController(
1616
client: client,
1717
owner: owner,
1818
repo: repo,
19-
type: .issues,
20-
label: label
19+
type: type,
20+
label: "\"" + label + "\""
2121
)
2222

2323
navigationController?.pushViewController(

0 commit comments

Comments
 (0)