Don't allow duplicate Reader API accounts to be created.

This commit is contained in:
Maurice Parker 2020-10-25 19:41:16 -05:00
parent d0a9d64062
commit 679cd40e84
1 changed files with 5 additions and 0 deletions

View File

@ -91,6 +91,11 @@ class AccountsReaderAPIWindowController: NSWindowController {
return
}
guard !AccountManager.shared.duplicateServiceAccount(type: accountType, username: usernameTextField.stringValue) else {
self.errorMessageLabel.stringValue = NSLocalizedString("There is already an account of this type with that username created.", comment: "Duplicate Error")
return
}
let apiURL: URL
switch accountType {
case .freshRSS: