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

cleans up issue labels query #2334

Merged
merged 1 commit into from
Oct 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Classes/Issues/IssuesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ final class IssuesViewController: MessageViewController,
private var needsScrollToBottom = false
private var lastTimelineElement: ListDiffable?
private var actions: IssueTextActionsView?
private var issueType: RepositoryIssuesType?

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

Expand Down Expand Up @@ -636,7 +638,8 @@ final class IssuesViewController: MessageViewController,
// MARK: IssueLabelsSectionControllerDelegate

func didTapIssueLabel(owner: String, repo: String, label: String) {
presentLabels(client: client, owner: owner, repo: repo, label: label)
guard let issueType = self.issueType else { return }
presentLabels(client: client, owner: owner, repo: repo, label: label, type: issueType)
}

}
2 changes: 1 addition & 1 deletion Classes/Repository/RepositoryIssuesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SearchBarSectionControllerDelegate {
self.type = type
self.label = label
if let label = label {
previousSearchString += "label:\(label) "
previousSearchString += "label:\"\(label)\" "
}

super.init(
Expand Down
4 changes: 2 additions & 2 deletions Classes/View Controllers/UIViewController+PresentLabels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import UIKit
import GitHubAPI

extension UIViewController {
func presentLabels(client: GithubClient, owner: String, repo: String, label: String) {
func presentLabels(client: GithubClient, owner: String, repo: String, label: String, type: RepositoryIssuesType) {
let repositoryIssuesViewController =
RepositoryIssuesViewController(
client: client,
owner: owner,
repo: repo,
type: .issues,
type: type,
label: label
)

Expand Down