From 679cd40e844dbc2e6724980349e2d78518074cab Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 25 Oct 2020 19:41:16 -0500 Subject: [PATCH] Don't allow duplicate Reader API accounts to be created. --- .../Accounts/AccountsReaderAPIWindowController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift b/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift index 35ce1c4c6..66a286151 100644 --- a/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift +++ b/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift @@ -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: