mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 09:50:16 +00:00
Delete newly-added Miniflux account on Mac if keychain storage fails.
This commit is contained in:
1 parent
0d0fefb60c
commit
3def44108f
1 file changed
+6
-1
@@ -151,7 +151,8 @@ final class AccountsMinifluxWindowController: NSWindowController {
|
||||
return
|
||||
}
|
||||
|
||||
if account == nil {
|
||||
let isNewAccount = account == nil
|
||||
if isNewAccount {
|
||||
account = AccountManager.shared.createAccount(type: .miniflux)
|
||||
}
|
||||
|
||||
@@ -175,6 +176,10 @@ final class AccountsMinifluxWindowController: NSWindowController {
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
if isNewAccount, let account {
|
||||
AccountManager.shared.deleteAccount(account)
|
||||
self.account = nil
|
||||
}
|
||||
errorMessageLabel?.stringValue = NSLocalizedString("Keychain error while storing credentials.", comment: "Credentials Error")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user