Don't allow duplicate accounts to be added for Feedbin, FeedWrangler, or NewsBlur. Issue #2448

This commit is contained in:
Maurice Parker 2020-09-24 20:20:01 -05:00
parent fff256f361
commit d0cc9654f2
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -55,7 +55,12 @@ class AccountsNewsBlurWindowController: NSWindowController {
self.errorMessageLabel.stringValue = NSLocalizedString("Username required.", comment: "Credentials Error") self.errorMessageLabel.stringValue = NSLocalizedString("Username required.", comment: "Credentials Error")
return return
} }
guard !AccountManager.shared.duplicateServiceAccount(type: .newsBlur, username: usernameTextField.stringValue) else {
self.errorMessageLabel.stringValue = NSLocalizedString("There is already a NewsBlur account with that username created.", comment: "Duplicate Error")
return
}
actionButton.isEnabled = false actionButton.isEnabled = false
progressIndicator.isHidden = false progressIndicator.isHidden = false
progressIndicator.startAnimation(self) progressIndicator.startAnimation(self)