If only selfie is missing use special phrases.
This commit is contained in:
parent
effa277a3b
commit
9929bfb281
|
@ -1561,6 +1561,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_passport_identity_internal" = "Internal passport";
|
"lng_passport_identity_internal" = "Internal passport";
|
||||||
"lng_passport_identity_internal_upload" = "Upload a scan of your internal passport";
|
"lng_passport_identity_internal_upload" = "Upload a scan of your internal passport";
|
||||||
"lng_passport_identity_about" = "The document must contain your photograph, first and last name, date of birth, document number, country of issue, and expiry date.";
|
"lng_passport_identity_about" = "The document must contain your photograph, first and last name, date of birth, document number, country of issue, and expiry date.";
|
||||||
|
"lng_passport_identity_selfie" = "Take a selfie with your document";
|
||||||
"lng_passport_address_title" = "Residential address";
|
"lng_passport_address_title" = "Residential address";
|
||||||
"lng_passport_address_description" = "Upload a proof of your address";
|
"lng_passport_address_description" = "Upload a proof of your address";
|
||||||
"lng_passport_address_bill" = "Utility bill";
|
"lng_passport_address_bill" = "Utility bill";
|
||||||
|
|
|
@ -264,6 +264,17 @@ ScopeRow ComputeScopeRow(const Scope &scope) {
|
||||||
ranges::for_each(scope.documents, addValueErrors);
|
ranges::for_each(scope.documents, addValueErrors);
|
||||||
addValueErrors(scope.fields);
|
addValueErrors(scope.fields);
|
||||||
row.error = errors.join('\n');
|
row.error = errors.join('\n');
|
||||||
|
if (row.error.isEmpty()
|
||||||
|
&& row.ready.isEmpty()
|
||||||
|
&& scope.type == Scope::Type::Identity
|
||||||
|
&& scope.selfieRequired) {
|
||||||
|
auto noSelfieScope = scope;
|
||||||
|
noSelfieScope.selfieRequired = false;
|
||||||
|
if (!ComputeScopeRowReadyString(noSelfieScope).isEmpty()) {
|
||||||
|
// Only selfie is missing.
|
||||||
|
row.description = lang(lng_passport_identity_selfie);
|
||||||
|
}
|
||||||
|
}
|
||||||
return row;
|
return row;
|
||||||
};
|
};
|
||||||
switch (scope.type) {
|
switch (scope.type) {
|
||||||
|
|
|
@ -813,6 +813,15 @@ int PanelController::findNonEmptyDocumentIndex(const Scope &scope) const {
|
||||||
if (i != end(documents)) {
|
if (i != end(documents)) {
|
||||||
return (i - begin(documents));
|
return (i - begin(documents));
|
||||||
}
|
}
|
||||||
|
// If we have a document where only selfie is not filled - return it.
|
||||||
|
const auto j = ranges::find_if(
|
||||||
|
documents,
|
||||||
|
[&](not_null<const Value*> document) {
|
||||||
|
return document->scansAreFilled(false);
|
||||||
|
});
|
||||||
|
if (j != end(documents)) {
|
||||||
|
return (j - begin(documents));
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue