Use accountType.createAccountURL property.

This commit is contained in:
Brent Simmons
2024-10-27 12:00:20 -07:00
parent 8ee58b48cf
commit 5d5f31f045
2 changed files with 9 additions and 23 deletions

View File

@@ -194,18 +194,12 @@ class AccountsReaderAPIWindowController: NSWindowController {
}
@IBAction func createAccountWithProvider(_ sender: Any) {
switch accountType {
case .freshRSS:
NSWorkspace.shared.open(URL(string: "https://freshrss.org")!)
case .inoreader:
NSWorkspace.shared.open(URL(string: "https://www.inoreader.com")!)
case .bazQux:
NSWorkspace.shared.open(URL(string: "https://bazqux.com")!)
case .theOldReader:
NSWorkspace.shared.open(URL(string: "https://theoldreader.com")!)
default:
guard let createAccountURL = accountType.createAccountURL else {
return
}
NSWorkspace.shared.open(createAccountURL)
}
// MARK: Autofill

View File

@@ -265,20 +265,12 @@ class ReaderAPIAccountViewController: UITableViewController {
}
@IBAction func signUpWithProvider(_ sender: Any) {
var url: URL!
switch accountType {
case .bazQux:
url = URL(string: "https://bazqux.com")!
case .inoreader:
url = URL(string: "https://www.inoreader.com")!
case .theOldReader:
url = URL(string: "https://theoldreader.com")!
case .freshRSS:
url = URL(string: "https://freshrss.org")!
default:
return
guard let createAccountURL = accountType.createAccountURL else {
return
}
let safari = SFSafariViewController(url: url)
let safari = SFSafariViewController(url: createAccountURL)
safari.modalPresentationStyle = .currentContext
self.present(safari, animated: true, completion: nil)
}