Show password generation settings automatically
This commit is contained in:
parent
aca01c8c72
commit
421b5aed1d
1 changed files with 18 additions and 4 deletions
|
|
@ -196,10 +196,8 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl
|
|||
// generate the password, don't care whether the original line is otp
|
||||
func generateAndCopyPasswordNoOtpCheck() {
|
||||
// show password settings (e.g., the length slider)
|
||||
if hidePasswordSettings == true {
|
||||
hidePasswordSettings = false
|
||||
tableView.reloadSections([passwordSection], with: .fade)
|
||||
}
|
||||
showPasswordSettings()
|
||||
|
||||
let length = passwordLengthCell?.roundedValue ?? 0
|
||||
let plainPassword = Utils.generatePassword(length: length)
|
||||
SecurePasteboard.shared.copy(textToCopy: plainPassword)
|
||||
|
|
@ -211,6 +209,15 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl
|
|||
fillPasswordCell?.setContent(content: plainPassword)
|
||||
}
|
||||
|
||||
// show password settings (e.g., the length slider)
|
||||
func showPasswordSettings() {
|
||||
if hidePasswordSettings == true {
|
||||
hidePasswordSettings = false
|
||||
tableView.reloadSections([passwordSection], with: .fade)
|
||||
}
|
||||
}
|
||||
|
||||
// show/hide password settings (e.g., the length slider)
|
||||
func showHidePasswordSettings() {
|
||||
hidePasswordSettings = !hidePasswordSettings
|
||||
tableView.reloadSections([passwordSection], with: .fade)
|
||||
|
|
@ -275,6 +282,13 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl
|
|||
}
|
||||
}
|
||||
|
||||
func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||
if textField == fillPasswordCell?.contentTextField {
|
||||
// show password generation settings automatically
|
||||
showPasswordSettings()
|
||||
}
|
||||
}
|
||||
|
||||
func getNameURL() -> (String, URL) {
|
||||
let encodedName = (nameCell?.getContent()?.stringByAddingPercentEncodingForRFC3986())!
|
||||
let name = URL(string: encodedName)!.lastPathComponent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue