From 19a2cc962d570ede48febe31e5c41ce26baa23b0 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 24 Sep 2020 20:29:56 -0500 Subject: [PATCH] Don't allow duplicate accounts to be added for FeedWrangler --- .../Accounts/AccountsFeedWranglerWindowController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Mac/Preferences/Accounts/AccountsFeedWranglerWindowController.swift b/Mac/Preferences/Accounts/AccountsFeedWranglerWindowController.swift index 22eaf0097..5f2e2081b 100644 --- a/Mac/Preferences/Accounts/AccountsFeedWranglerWindowController.swift +++ b/Mac/Preferences/Accounts/AccountsFeedWranglerWindowController.swift @@ -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)