|
@@ -150,7 +150,11 @@ class AccountSetupController: UITableViewController {
|
|
|
}()
|
|
|
|
|
|
// this loginButton can be enabled and disabled
|
|
|
- lazy var loginButton: UIBarButtonItem = UIBarButtonItem(title: "Login", style: .done, target: self, action: #selector(loginButtonPressed))
|
|
|
+ private lazy var loginButton: UIBarButtonItem = {
|
|
|
+ let button = UIBarButtonItem(title: "Login", style: .done, target: self, action: #selector(loginButtonPressed))
|
|
|
+ button.isEnabled = dc_is_configured(mailboxPointer) == 0
|
|
|
+ return button
|
|
|
+ }()
|
|
|
|
|
|
private lazy var basicSectionCells: [UITableViewCell] = [emailCell, passwordCell]
|
|
|
private lazy var restoreCells: [UITableViewCell] = [restoreCell]
|
|
@@ -563,6 +567,7 @@ extension AccountSetupController: UITextFieldDelegate {
|
|
|
|
|
|
func textFieldDidBeginEditing(_ textField: UITextField) {
|
|
|
if textField.accessibilityIdentifier == "emailTextField" {
|
|
|
+ loginButton.isEnabled = true
|
|
|
// this will re-enable possible oAuth2-login
|
|
|
skipOauth = false
|
|
|
}
|
|
@@ -635,7 +640,7 @@ extension AccountSetupController {
|
|
|
func showProgressHud() {
|
|
|
configProgressAlert.actions[0].isEnabled = true
|
|
|
configProgressAlert.title = "Configuring Account"
|
|
|
- configProgressAlert.message = "\n\n\n"
|
|
|
+ configProgressAlert.message = "\n\n\n" // workaround to create space for progress indicator
|
|
|
configProgressIndicator.alpha = 1
|
|
|
configProgressIndicator.value = 0
|
|
|
present(configProgressAlert, animated: true, completion: nil)
|
|
@@ -653,6 +658,7 @@ extension AccountSetupController {
|
|
|
configProgressIndicator.alpha = 0
|
|
|
configProgressAlert.title = "Login Successful!"
|
|
|
configProgressAlert.message = "You are ready to use Delta Chat."
|
|
|
+ loginButton.isEnabled = dc_is_configured(mailboxPointer) == 0
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: {
|
|
|
self.configProgressAlert.dismiss(animated: true) {
|
|
|
self.handleLoginSuccess()
|