diff --git a/iOS/Account/FeedbinAddAccountView.swift b/iOS/Account/FeedbinAddAccountView.swift index 0fac486cb..51db90293 100644 --- a/iOS/Account/FeedbinAddAccountView.swift +++ b/iOS/Account/FeedbinAddAccountView.swift @@ -99,6 +99,7 @@ struct FeedbinAddAccountView: View { Spacer() } } + .disabled(!validateCredentials()) } } @@ -110,6 +111,13 @@ struct FeedbinAddAccountView: View { return Text("").multilineTextAlignment(.center) } + private func validateCredentials() -> Bool { + if (accountEmail.trimmingWhitespace.count == 0) || (accountPassword.trimmingWhitespace.count == 0) { + return false + } + return true + } + private func retrieveCredentials() { if let account = account { do { diff --git a/iOS/Account/NewsBlurAddAccountView.swift b/iOS/Account/NewsBlurAddAccountView.swift index 37a414d2a..f15387faf 100644 --- a/iOS/Account/NewsBlurAddAccountView.swift +++ b/iOS/Account/NewsBlurAddAccountView.swift @@ -116,6 +116,7 @@ struct NewsBlurAddAccountView: View, Logging { Spacer() } } + .disabled(!validateCredentials()) } } @@ -127,6 +128,13 @@ struct NewsBlurAddAccountView: View, Logging { return Text("").multilineTextAlignment(.center) } + private func validateCredentials() -> Bool { + if (accountUserName.trimmingWhitespace.count == 0) || (accountPassword.trimmingWhitespace.count == 0) { + return false + } + return true + } + private func executeAccountCredentials() async throws { let trimmedUsername = accountUserName.trimmingWhitespace