Update iOS to work with the latest Account API

This commit is contained in:
Maurice Parker 2019-06-20 11:27:35 -05:00
parent 1ac1144b2d
commit 9f47139011
3 changed files with 6 additions and 6 deletions

View File

@ -93,7 +93,7 @@ struct SettingsFeedbinAccountView : View {
do { do {
do { do {
try workAccount.removeBasicCredentials() try workAccount.removeCredentials()
} catch {} } catch {}
try workAccount.storeCredentials(credentials) try workAccount.storeCredentials(credentials)
@ -132,7 +132,7 @@ struct SettingsFeedbinAccountView : View {
init(account: Account) { init(account: Account) {
self.account = account self.account = account
if case .basic(let username, let password) = try? account.retrieveBasicCredentials() { if case .basic(let username, let password) = try? account.retrieveCredentials() {
self.email = username self.email = username
self.password = password self.password = password
} }

View File

@ -104,7 +104,7 @@ struct SettingsReaderAPIAccountView : View {
do { do {
do { do {
try workAccount.removeBasicCredentials() try workAccount.removeCredentials()
} catch {} } catch {}
workAccount.endpointURL = apiURL workAccount.endpointURL = apiURL
@ -149,7 +149,7 @@ struct SettingsReaderAPIAccountView : View {
init(accountType: AccountType, account: Account) { init(accountType: AccountType, account: Account) {
self.account = account self.account = account
self.accountType = accountType self.accountType = accountType
if case .basic(let username, let password) = try? account.retrieveBasicCredentials() { if case .basic(let username, let password) = try? account.retrieveCredentials() {
self.email = username self.email = username
self.password = password self.password = password
} }

View File

@ -30,7 +30,7 @@ class FeedbinAccountViewController: UIViewController {
emailTextField.delegate = self emailTextField.delegate = self
passwordTextField.delegate = self passwordTextField.delegate = self
if let account = account, let credentials = try? account.retrieveBasicCredentials() { if let account = account, let credentials = try? account.retrieveCredentials() {
actionButton.setTitle(NSLocalizedString("Update Credentials", comment: "Update Credentials"), for: .normal) actionButton.setTitle(NSLocalizedString("Update Credentials", comment: "Update Credentials"), for: .normal)
if case .basic(let username, let password) = credentials { if case .basic(let username, let password) = credentials {
emailTextField.text = username emailTextField.text = username
@ -77,7 +77,7 @@ class FeedbinAccountViewController: UIViewController {
do { do {
do { do {
try self.account?.removeBasicCredentials() try self.account?.removeCredentials()
} catch {} } catch {}
try self.account?.storeCredentials(credentials) try self.account?.storeCredentials(credentials)