Show cancel button by default for password (instead of showing cancel after three wrong attempts)

This commit is contained in:
Bob Sun 2017-02-26 21:12:17 +08:00
parent ea3c12f2e4
commit 44f148c7ea
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -43,12 +43,10 @@ struct GitCredential {
PasswordStore.shared.gitRepositoryPassword = newPassword
sem.signal()
}))
if Defaults[.gitRepositoryPasswordAttempts] == 3 {
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel) { _ in
Defaults[.gitRepositoryPasswordAttempts] = -1
sem.signal()
})
}
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel) { _ in
Defaults[.gitRepositoryPasswordAttempts] = -1
sem.signal()
})
alert.addTextField(configurationHandler: {(textField: UITextField!) in
textField.text = PasswordStore.shared.gitRepositoryPassword
textField.isSecureTextEntry = true