@adyen/kyc-components 3.8.1 → 3.8.2

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.
@@ -31945,6 +31945,31 @@ function TrustDropinComponent({
31945
31945
  const requiredForms = getRequiredForms(trustForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
31946
31946
  return addValidityToForms(requiredForms, formValidity, problems);
31947
31947
  }, [derivedProps, formValidity, problems]);
31948
+ useEffect(() => {
31949
+ var _a2;
31950
+ const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
31951
+ try {
31952
+ if (documentIds.length) {
31953
+ documentUtils.fetchDocuments(documentIds, legalEntityResponse.id).then(() => {
31954
+ const mappedDocuments = mapApiDocumentToTrustDocument(legalEntityResponse.id);
31955
+ setData({
31956
+ ...data,
31957
+ ...mappedDocuments
31958
+ });
31959
+ }).catch(() => {
31960
+ showToast({
31961
+ label: i18n.get("failedToFetchRelevantDocuments"),
31962
+ type: ToastType.ERROR
31963
+ });
31964
+ });
31965
+ }
31966
+ } catch (e) {
31967
+ showToast({
31968
+ label: i18n.get("failedToFetchRelevantDocuments"),
31969
+ type: ToastType.ERROR
31970
+ });
31971
+ }
31972
+ }, []);
31948
31973
  const onSubmit = async () => {
31949
31974
  setLoadingStatus("loading");
31950
31975
  const trustDetails2 = mapTrustToLegalEntity(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.8.1",
3
+ "version": "3.8.2",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [