@adyen/kyc-components 3.0.0-beta.10 → 3.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12466,8 +12466,13 @@ const mapIndividualDocumentToApiDocument = async (data, entityId) => {
|
|
|
12466
12466
|
}
|
|
12467
12467
|
};
|
|
12468
12468
|
const mapApiIdDocumentToSchema = (idDocument2) => {
|
|
12469
|
-
const
|
|
12470
|
-
|
|
12469
|
+
const {
|
|
12470
|
+
hasBackPage
|
|
12471
|
+
} = idDocumentTypeOptions.find(({
|
|
12472
|
+
id: id2
|
|
12473
|
+
}) => id2 === idDocument2.type);
|
|
12474
|
+
const frontPage2 = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
|
|
12475
|
+
const backPage2 = hasBackPage ? getPage(idDocument2, "back") : void 0;
|
|
12471
12476
|
return {
|
|
12472
12477
|
...frontPage2 ? {
|
|
12473
12478
|
idFrontPage: [{
|
|
@@ -12707,40 +12712,34 @@ function IdDocumentManualUploadComponent(props) {
|
|
|
12707
12712
|
prevState,
|
|
12708
12713
|
changeInitiatedBy
|
|
12709
12714
|
}) => {
|
|
12710
|
-
var _a2, _b, _c, _d, _e, _f
|
|
12711
|
-
if (changeInitiatedBy === "idDocument") {
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
if (!isBackPageSelected) {
|
|
12739
|
-
setIdBackPage({
|
|
12740
|
-
idBackPage: null
|
|
12741
|
-
});
|
|
12742
|
-
}
|
|
12743
|
-
}
|
|
12715
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
12716
|
+
if (changeInitiatedBy === "idDocument" && ((_b = (_a2 = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a2.idDocument) == null ? void 0 : _b.idDocumentType) !== ((_d = (_c = prevState == null ? void 0 : prevState.data) == null ? void 0 : _c.idDocument) == null ? void 0 : _d.idDocumentType)) {
|
|
12717
|
+
const idDocumentType = (_f = (_e = currentState.data) == null ? void 0 : _e.idDocument) == null ? void 0 : _f.idDocumentType;
|
|
12718
|
+
const document2 = idDocumentType ? getDocument$1(props.legalEntityId, idDocumentType) : void 0;
|
|
12719
|
+
if (!document2) {
|
|
12720
|
+
setIdFrontPage({
|
|
12721
|
+
idFrontPage: null
|
|
12722
|
+
});
|
|
12723
|
+
setIdBackPage({
|
|
12724
|
+
idBackPage: null
|
|
12725
|
+
});
|
|
12726
|
+
} else if (hasBackPage(idDocumentType)) {
|
|
12727
|
+
setIdFrontPage({
|
|
12728
|
+
idFrontPage: [{
|
|
12729
|
+
name: getPageName(document2, "front")
|
|
12730
|
+
}]
|
|
12731
|
+
});
|
|
12732
|
+
setIdBackPage({
|
|
12733
|
+
idBackPage: [{
|
|
12734
|
+
name: getPageName(document2, "back")
|
|
12735
|
+
}]
|
|
12736
|
+
});
|
|
12737
|
+
} else {
|
|
12738
|
+
setIdFrontPage({
|
|
12739
|
+
idFrontPage: [{
|
|
12740
|
+
name: getPageName(document2)
|
|
12741
|
+
}]
|
|
12742
|
+
});
|
|
12744
12743
|
}
|
|
12745
12744
|
}
|
|
12746
12745
|
};
|