mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[AltServer] Adds “Search FAQ” button to ErrorDetailsViewController
This commit is contained in:
@@ -44,5 +44,20 @@ private extension ErrorDetailsViewController
|
||||
let detailedDescription = error.formattedDetailedDescription(with: font)
|
||||
self.detailedDescriptionLabel.attributedStringValue = detailedDescription
|
||||
}
|
||||
|
||||
@IBAction func searchFAQ(_ sender: NSButton)
|
||||
{
|
||||
guard let error else { return }
|
||||
|
||||
let baseURL = URL(string: "https://faq.altstore.io/getting-started/error-codes")!
|
||||
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: false)!
|
||||
|
||||
let nsError = error as NSError
|
||||
let query = [nsError.domain, "\(error.displayCode)"].joined(separator: "+")
|
||||
components.queryItems = [URLQueryItem(name: "q", value: query)]
|
||||
|
||||
let url = components.url ?? baseURL
|
||||
NSWorkspace.shared.open(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user