mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-04 03:08:43 +00:00
Offer update-credentials for all username/password accounts (not Feedbin only).
This commit is contained in:
1 parent
a44cfe13ce
commit
263ec26831
3 files changed
+11
-13
No files matched your search
@@ -35,21 +35,19 @@ private extension UIViewController {
|
||||
let title = NSLocalizedString("Account Error", comment: "Account Error")
|
||||
let alertController = UIAlertController(title: title, message: error.localizedDescription, preferredStyle: .alert)
|
||||
|
||||
let account = AccountError.account(from: error)
|
||||
if account?.type == .feedbin {
|
||||
|
||||
if let account = AccountError.account(from: error), CredentialsAccountView.accountTypes.contains(account.type) {
|
||||
let credentialsTitle = NSLocalizedString("Update Credentials", comment: "Update Credentials")
|
||||
let credentialsAction = UIAlertAction(title: credentialsTitle, style: .default) { [weak self] _ in
|
||||
dismiss?()
|
||||
|
||||
let hostingController = UIHostingController(rootView: CredentialsAccountView(accountType: .feedbin, account: account, didAddAccount: nil))
|
||||
let hostingController = UIHostingController(rootView: CredentialsAccountView(accountType: account.type, account: account, didAddAccount: nil))
|
||||
hostingController.modalPresentationStyle = .formSheet
|
||||
hostingController.preferredContentSize = UIViewController.formSheetSize
|
||||
self?.present(hostingController, animated: true)
|
||||
}
|
||||
|
||||
alertController.addAction(credentialsAction)
|
||||
alertController.preferredAction = credentialsAction
|
||||
|
||||
}
|
||||
|
||||
let dismissTitle = NSLocalizedString("OK", comment: "OK button")
|
||||
|
||||
Reference in new issue
Block a user