v5.3.5 Disabling password verification for files import

This commit is contained in:
Zbigniew Cisiński 2024-03-18 23:37:32 +01:00
parent e45c17afdf
commit b73f9870fd
3 changed files with 14 additions and 2 deletions

View File

@ -28,6 +28,7 @@ final class PasswordTextField: LimitedTextField {
var isActive: Callback?
var textDidChange: TextDidChange?
var didResign: Callback?
var verifyPassword = true
override func textField(
_ textField: UITextField,
@ -43,13 +44,13 @@ final class PasswordTextField: LimitedTextField {
let matches = string.matches(ExportFileRules.regExp) || string.isBackspace
if !matches {
if !matches && verifyPassword {
notAllowedCharacter?()
} else {
textDidChange?(newString as String)
}
return matches
return matches || !verifyPassword
}
override func resignFirstResponder() -> Bool {

View File

@ -51,6 +51,16 @@ final class RevealPasswordInput: UIView {
input.text ?? ""
}
var verifyPassword: Bool {
get {
input.verifyPassword
}
set {
input.verifyPassword = newValue
}
}
private let lineHeight: CGFloat = 25
private let titleLabel = TitleLabel()

View File

@ -106,6 +106,7 @@ final class ImporterEnterPasswordViewController: UIViewController {
private func configureInput() {
input.order = .first
input.verifyPassword = false
input.completeAction = { [weak self] in self?.done() }
input.didResign = { [weak self] in self?.done() }