Don't allow duplicate accounts to be added for FeedWrangler

This commit is contained in:
Maurice Parker 2020-09-24 20:29:56 -05:00
parent d0cc9654f2
commit 19a2cc962d
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ class AccountsFeedWranglerWindowController: NSWindowController {
return
}
guard !AccountManager.shared.duplicateServiceAccount(type: .feedWrangler, username: usernameTextField.stringValue) else {
self.errorMessageLabel.stringValue = NSLocalizedString("There is already a FeedWrangler account with that username created.", comment: "Duplicate Error")
return
}
actionButton.isEnabled = false
progressIndicator.isHidden = false
progressIndicator.startAnimation(self)