Update to use latest webservice network layer in RSWeb

This commit is contained in:
Maurice Parker
2019-05-04 08:54:07 -05:00
parent 1b49788a0a
commit bb42e46887
7 changed files with 46 additions and 61 deletions

View File

@@ -60,16 +60,21 @@ class AccountsAddFeedbinWindowController: NSWindowController, NSTextFieldDelegat
self.progressIndicator.isHidden = true
self.progressIndicator.stopAnimation(self)
if result {
switch result {
case .success(let authenticated):
let account = AccountManager.shared.createAccount(type: .feedbin)
account.storeCredentials(username: self.usernameTextField.stringValue, password: self.passwordTextField.stringValue)
if authenticated {
let account = AccountManager.shared.createAccount(type: .feedbin)
account.storeCredentials(username: self.usernameTextField.stringValue, password: self.passwordTextField.stringValue)
self.hostWindow?.endSheet(self.window!, returnCode: NSApplication.ModalResponse.OK)
} else {
self.errorMessageLabel.stringValue = NSLocalizedString("Unable to verify credentials.", comment: "Credentials Error")
}
case .failure:
self.hostWindow?.endSheet(self.window!, returnCode: NSApplication.ModalResponse.OK)
} else {
self.errorMessageLabel.stringValue = NSLocalizedString("Unable to verify credentials", comment: "Credentials Error")
self.errorMessageLabel.stringValue = NSLocalizedString("Unable to verify credentials due to networking error.", comment: "Credentials Error")
}