mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 05:26:48 +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()
|
self.item?.activated()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func selected() {
|
||||||
|
activate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -151,7 +151,11 @@ class ItemListRevealOptionsItemNode: ListViewItemNode, UIGestureRecognizerDelega
|
|||||||
}
|
}
|
||||||
|
|
||||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||||
|
if let recognizer = self.recognizer, otherGestureRecognizer == recognizer {
|
||||||
return true
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func revealTapGesture(_ recognizer: UITapGestureRecognizer) {
|
@objc func revealTapGesture(_ recognizer: UITapGestureRecognizer) {
|
||||||
|
|||||||
@ -114,7 +114,7 @@ final class SecureIdAuthController: ViewController {
|
|||||||
strongSelf.updateState(animated: true, { state in
|
strongSelf.updateState(animated: true, { state in
|
||||||
var state = state
|
var state = state
|
||||||
state.verificationState = .verified(context.context)
|
state.verificationState = .verified(context.context)
|
||||||
state.twoStepEmail = context.settings.email
|
state.twoStepEmail = !context.settings.email.isEmpty ? context.settings.email : nil
|
||||||
switch state {
|
switch state {
|
||||||
case var .form(form):
|
case var .form(form):
|
||||||
form.formData = form.encryptedFormData.flatMap({ decryptedSecureIdForm(context: context.context, form: $0.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
|
strongSelf.updateState(animated: !inBackground, { state in
|
||||||
var state = state
|
var state = state
|
||||||
state.verificationState = .verified(context.context)
|
state.verificationState = .verified(context.context)
|
||||||
state.twoStepEmail = context.settings.email
|
state.twoStepEmail = !context.settings.email.isEmpty ? context.settings.email : nil
|
||||||
switch state {
|
switch state {
|
||||||
case var .form(form):
|
case var .form(form):
|
||||||
form.formData = form.encryptedFormData.flatMap({ decryptedSecureIdForm(context: context.context, form: $0.form) })
|
form.formData = form.encryptedFormData.flatMap({ decryptedSecureIdForm(context: context.context, form: $0.form) })
|
||||||
|
|||||||
@ -738,7 +738,7 @@ final class SecureIdAuthControllerNode: ViewControllerTracingNode {
|
|||||||
case .temporaryRegistration:
|
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)
|
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:
|
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:
|
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)
|
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:
|
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)))
|
text.append(fieldsText(addressValue.street1, addressValue.street2, addressValue.city, addressValue.state, addressValue.postcode, countryName(code: addressValue.countryCode, strings: strings)))
|
||||||
}
|
}
|
||||||
}
|
} else if let filledDocument = filledDocument, let string = stringForDocumentValue(filledDocument.1, strings: strings) {
|
||||||
if let filledDocument = filledDocument, let string = stringForDocumentValue(filledDocument.1, strings: strings) {
|
|
||||||
if !text.isEmpty {
|
if !text.isEmpty {
|
||||||
text.append(", ")
|
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))
|
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 {
|
if let document = address.document {
|
||||||
|
guard !verificationDocuments.isEmpty else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
switch document {
|
switch document {
|
||||||
case .passportRegistration:
|
case .passportRegistration:
|
||||||
values[.passportRegistration] = .passportRegistration(SecureIdPassportRegistrationValue(verificationDocuments: verificationDocuments, translations: translationDocuments))
|
values[.passportRegistration] = .passportRegistration(SecureIdPassportRegistrationValue(verificationDocuments: verificationDocuments, translations: translationDocuments))
|
||||||
@ -2100,9 +2103,17 @@ final class SecureIdDocumentFormControllerNode: FormControllerNode<SecureIdDocum
|
|||||||
strongSelf.enumerateItemsAndEntries({ itemEntry, itemNode in
|
strongSelf.enumerateItemsAndEntries({ itemEntry, itemNode in
|
||||||
if itemEntry.isEqual(to: entry) {
|
if itemEntry.isEqual(to: entry) {
|
||||||
useNext = true
|
useNext = true
|
||||||
} else if useNext, let inputNode = itemNode as? FormControllerTextInputItemNode {
|
} else if useNext {
|
||||||
|
if case .deleteDocument = itemEntry {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
else if let inputNode = itemNode as? FormControllerTextInputItemNode {
|
||||||
inputNode.activate()
|
inputNode.activate()
|
||||||
return false
|
return false
|
||||||
|
} else if let actionNode = itemNode as? FormControllerDetailActionItemNode {
|
||||||
|
actionNode.activate()
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
@ -2569,10 +2580,25 @@ final class SecureIdDocumentFormControllerNode: FormControllerNode<SecureIdDocum
|
|||||||
let dismissAction: () -> Void = { [weak controller] in
|
let dismissAction: () -> Void = { [weak controller] in
|
||||||
controller?.dismissAnimated()
|
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([
|
controller.setItemGroups([
|
||||||
ActionSheetItemGroup(items: [
|
ActionSheetItemGroup(items: [
|
||||||
ActionSheetTextItem(title: self.strings.Passport_DeleteDocumentConfirmation),
|
ActionSheetTextItem(title: text),
|
||||||
ActionSheetButtonItem(title: strings.Passport_DeleteDocument, color: .destructive, action: { [weak self] in
|
ActionSheetButtonItem(title: title, color: .destructive, action: { [weak self] in
|
||||||
dismissAction()
|
dismissAction()
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -916,6 +916,8 @@ final class SecureIdPlaintextFormControllerNode: FormControllerNode<SecureIdPlai
|
|||||||
switch error {
|
switch error {
|
||||||
case .generic:
|
case .generic:
|
||||||
errorText = strongSelf.strings.Login_UnknownError
|
errorText = strongSelf.strings.Login_UnknownError
|
||||||
|
case .invalidEmail:
|
||||||
|
errorText = strongSelf.strings.TwoStepAuth_EmailInvalid
|
||||||
case .flood:
|
case .flood:
|
||||||
errorText = strongSelf.strings.Login_CodeFloodError
|
errorText = strongSelf.strings.Login_CodeFloodError
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user