mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 13:13:55 +00:00
no message
This commit is contained in:
parent
78dca463ea
commit
11c9b86287
@ -103,7 +103,11 @@ final class FormControllerDetailActionItemNode: FormBlockItemNode<FormController
|
||||
})
|
||||
}
|
||||
|
||||
override func selected() {
|
||||
func activate() {
|
||||
self.item?.activated()
|
||||
}
|
||||
|
||||
override func selected() {
|
||||
activate()
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,7 +151,11 @@ class ItemListRevealOptionsItemNode: ListViewItemNode, UIGestureRecognizerDelega
|
||||
}
|
||||
|
||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||
return true
|
||||
if let recognizer = self.recognizer, otherGestureRecognizer == recognizer {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@objc func revealTapGesture(_ recognizer: UITapGestureRecognizer) {
|
||||
|
||||
@ -114,7 +114,7 @@ final class SecureIdAuthController: ViewController {
|
||||
strongSelf.updateState(animated: true, { state in
|
||||
var state = state
|
||||
state.verificationState = .verified(context.context)
|
||||
state.twoStepEmail = context.settings.email
|
||||
state.twoStepEmail = !context.settings.email.isEmpty ? context.settings.email : nil
|
||||
switch state {
|
||||
case var .form(form):
|
||||
form.formData = form.encryptedFormData.flatMap({ decryptedSecureIdForm(context: context.context, form: $0.form) })
|
||||
@ -418,7 +418,7 @@ final class SecureIdAuthController: ViewController {
|
||||
strongSelf.updateState(animated: !inBackground, { state in
|
||||
var state = state
|
||||
state.verificationState = .verified(context.context)
|
||||
state.twoStepEmail = context.settings.email
|
||||
state.twoStepEmail = !context.settings.email.isEmpty ? context.settings.email : nil
|
||||
switch state {
|
||||
case var .form(form):
|
||||
form.formData = form.encryptedFormData.flatMap({ decryptedSecureIdForm(context: context.context, form: $0.form) })
|
||||
|
||||
@ -738,7 +738,7 @@ final class SecureIdAuthControllerNode: ViewControllerTracingNode {
|
||||
case .temporaryRegistration:
|
||||
strongSelf.interaction.present(SecureIdDocumentFormController(account: strongSelf.account, context: context, requestedData: .address(details: false, document: .temporaryRegistration, translations: true), primaryLanguageByCountry: primaryLanguageByCountry, values: values, updatedValues: updatedValues(field)), nil)
|
||||
case .address:
|
||||
strongSelf.interaction.present(SecureIdDocumentFormController(account: strongSelf.account, context: context, requestedData: .address(details: true, document: nil, translations: true), primaryLanguageByCountry: primaryLanguageByCountry, values: values, updatedValues: updatedValues(field)), nil)
|
||||
strongSelf.interaction.present(SecureIdDocumentFormController(account: strongSelf.account, context: context, requestedData: .address(details: true, document: nil, translations: false), primaryLanguageByCountry: primaryLanguageByCountry, values: values, updatedValues: updatedValues(field)), nil)
|
||||
case .utilityBill:
|
||||
strongSelf.interaction.present(SecureIdDocumentFormController(account: strongSelf.account, context: context, requestedData: .address(details: false, document: .utilityBill, translations: true), primaryLanguageByCountry: primaryLanguageByCountry, values: values, updatedValues: updatedValues(field)), nil)
|
||||
case .bankStatement:
|
||||
|
||||
@ -647,8 +647,7 @@ private func fieldTitleAndText(field: SecureIdParsedRequestedFormField, strings:
|
||||
}
|
||||
text.append(fieldsText(addressValue.street1, addressValue.street2, addressValue.city, addressValue.state, addressValue.postcode, countryName(code: addressValue.countryCode, strings: strings)))
|
||||
}
|
||||
}
|
||||
if let filledDocument = filledDocument, let string = stringForDocumentValue(filledDocument.1, strings: strings) {
|
||||
} else if let filledDocument = filledDocument, let string = stringForDocumentValue(filledDocument.1, strings: strings) {
|
||||
if !text.isEmpty {
|
||||
text.append(", ")
|
||||
}
|
||||
|
||||
@ -1257,6 +1257,9 @@ extension SecureIdDocumentFormState {
|
||||
values[.address] = .address(SecureIdAddressValue(street1: details.street1, street2: details.street2, city: details.city, state: details.state, countryCode: details.countryCode, postcode: details.postcode))
|
||||
}
|
||||
if let document = address.document {
|
||||
guard !verificationDocuments.isEmpty else {
|
||||
return nil
|
||||
}
|
||||
switch document {
|
||||
case .passportRegistration:
|
||||
values[.passportRegistration] = .passportRegistration(SecureIdPassportRegistrationValue(verificationDocuments: verificationDocuments, translations: translationDocuments))
|
||||
@ -2100,9 +2103,17 @@ final class SecureIdDocumentFormControllerNode: FormControllerNode<SecureIdDocum
|
||||
strongSelf.enumerateItemsAndEntries({ itemEntry, itemNode in
|
||||
if itemEntry.isEqual(to: entry) {
|
||||
useNext = true
|
||||
} else if useNext, let inputNode = itemNode as? FormControllerTextInputItemNode {
|
||||
inputNode.activate()
|
||||
return false
|
||||
} else if useNext {
|
||||
if case .deleteDocument = itemEntry {
|
||||
return false
|
||||
}
|
||||
else if let inputNode = itemNode as? FormControllerTextInputItemNode {
|
||||
inputNode.activate()
|
||||
return false
|
||||
} else if let actionNode = itemNode as? FormControllerDetailActionItemNode {
|
||||
actionNode.activate()
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
@ -2569,10 +2580,25 @@ final class SecureIdDocumentFormControllerNode: FormControllerNode<SecureIdDocum
|
||||
let dismissAction: () -> Void = { [weak controller] in
|
||||
controller?.dismissAnimated()
|
||||
}
|
||||
|
||||
let text: String
|
||||
let title: String
|
||||
switch innerState.documentState {
|
||||
case let .identity(state) where state.details != nil:
|
||||
text = self.strings.Passport_DeletePersonalDetailsConfirmation
|
||||
title = self.strings.Passport_DeletePersonalDetails
|
||||
case let .address(state) where state.details != nil:
|
||||
text = self.strings.Passport_DeleteAddressConfirmation
|
||||
title = self.strings.Passport_DeleteAddress
|
||||
default:
|
||||
text = self.strings.Passport_DeleteDocumentConfirmation
|
||||
title = self.strings.Passport_DeleteDocument
|
||||
}
|
||||
|
||||
controller.setItemGroups([
|
||||
ActionSheetItemGroup(items: [
|
||||
ActionSheetTextItem(title: self.strings.Passport_DeleteDocumentConfirmation),
|
||||
ActionSheetButtonItem(title: strings.Passport_DeleteDocument, color: .destructive, action: { [weak self] in
|
||||
ActionSheetTextItem(title: text),
|
||||
ActionSheetButtonItem(title: title, color: .destructive, action: { [weak self] in
|
||||
dismissAction()
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
|
||||
@ -914,10 +914,12 @@ final class SecureIdPlaintextFormControllerNode: FormControllerNode<SecureIdPlai
|
||||
strongSelf.updateInnerState(transition: .immediate, with: innerState)
|
||||
let errorText: String
|
||||
switch error {
|
||||
case .generic:
|
||||
errorText = strongSelf.strings.Login_UnknownError
|
||||
case .flood:
|
||||
errorText = strongSelf.strings.Login_CodeFloodError
|
||||
case .generic:
|
||||
errorText = strongSelf.strings.Login_UnknownError
|
||||
case .invalidEmail:
|
||||
errorText = strongSelf.strings.TwoStepAuth_EmailInvalid
|
||||
case .flood:
|
||||
errorText = strongSelf.strings.Login_CodeFloodError
|
||||
}
|
||||
strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: errorText, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), nil)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user