Enable view source to open in GitHawk

This commit is contained in:
Alex Figueroa
2018-04-02 17:31:15 -04:00
parent 5fd68c1e6a
commit 2bf6f8749e
2 changed files with 14 additions and 4 deletions

View File

@@ -107,6 +107,7 @@ NewIssueTableViewControllerDelegate {
deselectRow()
onReportBug()
} else if cell === viewSourceCell {
deselectRow()
onViewSource()
} else if cell === signOutCell {
deselectRow()
@@ -157,9 +158,19 @@ NewIssueTableViewControllerDelegate {
}
func onViewSource() {
guard let url = URL(string: Constants.URLs.repository)
else { fatalError("Should always create GitHub URL") }
presentSafari(url: url)
guard let client = client else {
ToastManager.showGenericError()
return
}
let repo = RepositoryDetails(
owner: "GitHawkApp",
name: "GitHawk",
defaultBranch: "master",
hasIssuesEnabled: true
)
let repoViewController = RepositoryViewController(client: client, repo: repo)
navigationController?.showDetailViewController(repoViewController, sender: self)
}
func onSignOut() {

View File

@@ -11,7 +11,6 @@ import Foundation
enum Constants {
enum URLs {
static let repository = "https://github.com/GitHawkApp/GitHawk/"
static let website = "http://www.githawk.com/"
static let blog = "http://blog.githawk.com/"
}