Fix some build errors.

This commit is contained in:
Brent Simmons 2024-04-06 22:24:15 -07:00
parent d132dd7cee
commit 057d35030b
2 changed files with 5 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import Account
import Tree import Tree
import Parser import Parser
import Core import Core
import CommonErrors
enum AddFeedType { enum AddFeedType {
case web case web
@ -105,7 +106,7 @@ class AddFeedViewController: UITableViewController {
} }
if account!.hasFeed(withURL: url.absoluteString) { if account!.hasFeed(withURL: url.absoluteString) {
presentError(AccountError.createErrorAlreadySubscribed) presentError(CommonError.createErrorAlreadySubscribed)
return return
} }

View File

@ -8,11 +8,12 @@
import UIKit import UIKit
import Account import Account
import CommonErrors
extension UIViewController { extension UIViewController {
func presentError(_ error: Error, dismiss: (() -> Void)? = nil) { func presentError(_ error: Error, dismiss: (() -> Void)? = nil) {
if let accountError = error as? AccountError, accountError.isCredentialsError { if let accountError = error as? CommonError, accountError.isCredentialsError {
presentAccountError(accountError, dismiss: dismiss) presentAccountError(accountError, dismiss: dismiss)
} else if let decodingError = error as? DecodingError { } else if let decodingError = error as? DecodingError {
let errorTitle = NSLocalizedString("Error", comment: "Error") let errorTitle = NSLocalizedString("Error", comment: "Error")
@ -55,7 +56,7 @@ extension UIViewController {
private extension UIViewController { private extension UIViewController {
func presentAccountError(_ error: AccountError, dismiss: (() -> Void)? = nil) { func presentAccountError(_ error: CommonError, dismiss: (() -> Void)? = nil) {
let title = NSLocalizedString("Account Error", comment: "Account Error") let title = NSLocalizedString("Account Error", comment: "Account Error")
let alertController = UIAlertController(title: title, message: error.localizedDescription, preferredStyle: .alert) let alertController = UIAlertController(title: title, message: error.localizedDescription, preferredStyle: .alert)