Delete newly-added Miniflux account on Mac if keychain storage fails.

This commit is contained in:
Brent Simmons committed 2026-11-25 14:45:01 -08:00
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")
}