mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-18 04:08:16 +08:00
Enable view source to open in GitHawk
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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/"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user