@huma-finance/widgets 0.0.61-beta.552 → 0.0.61-beta.556
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.
package/dist/cjs/index.cjs
CHANGED
|
@@ -5620,8 +5620,9 @@ function PersonaEvaluation(_ref) {
|
|
|
5620
5620
|
case shared.IdentityVerificationStatusV2.NOT_STARTED:
|
|
5621
5621
|
{
|
|
5622
5622
|
const startVerificationResult = await shared.IdentityServiceV2.startVerification(account, chainId, isDev);
|
|
5623
|
+
const isVerificationBypassed = startVerificationResult.status === shared.IdentityVerificationStatusV2.BYPASSED;
|
|
5623
5624
|
setInquiryId(startVerificationResult.personaInquiryId);
|
|
5624
|
-
setKYCCopy(KYCCopies.verifyIdentity);
|
|
5625
|
+
setKYCCopy(isVerificationBypassed ? KYCCopies.verificationBypassed : KYCCopies.verifyIdentity);
|
|
5625
5626
|
setLoadingType(undefined);
|
|
5626
5627
|
break;
|
|
5627
5628
|
}
|
|
@@ -5727,7 +5728,7 @@ function PersonaEvaluation(_ref) {
|
|
|
5727
5728
|
modalElement.style.visibility = showPersonaClient ? 'hidden' : 'visible';
|
|
5728
5729
|
}
|
|
5729
5730
|
}, [showPersonaClient]);
|
|
5730
|
-
const startKYC = async () => {
|
|
5731
|
+
const startKYC = React.useCallback(async () => {
|
|
5731
5732
|
isActionOngoingRef.current = true;
|
|
5732
5733
|
isKYCResumedRef.current = false;
|
|
5733
5734
|
setLoadingType('startKYC');
|
|
@@ -5756,7 +5757,21 @@ function PersonaEvaluation(_ref) {
|
|
|
5756
5757
|
setLoadingType(undefined);
|
|
5757
5758
|
}
|
|
5758
5759
|
});
|
|
5759
|
-
};
|
|
5760
|
+
}, [checkVerificationStatus, inquiryId, sessionToken]);
|
|
5761
|
+
|
|
5762
|
+
// Start KYC flow directly
|
|
5763
|
+
React.useEffect(() => {
|
|
5764
|
+
if (verificationStatus) {
|
|
5765
|
+
switch (verificationStatus.status) {
|
|
5766
|
+
case shared.IdentityVerificationStatusV2.NOT_STARTED:
|
|
5767
|
+
case shared.IdentityVerificationStatusV2.CREATED:
|
|
5768
|
+
case shared.IdentityVerificationStatusV2.PENDING:
|
|
5769
|
+
case shared.IdentityVerificationStatusV2.EXPIRED:
|
|
5770
|
+
startKYC();
|
|
5771
|
+
break;
|
|
5772
|
+
}
|
|
5773
|
+
}
|
|
5774
|
+
}, [startKYC, verificationStatus]);
|
|
5760
5775
|
const handleAction = () => {
|
|
5761
5776
|
if (verificationStatus) {
|
|
5762
5777
|
switch (verificationStatus.status) {
|
|
@@ -5771,6 +5786,9 @@ function PersonaEvaluation(_ref) {
|
|
|
5771
5786
|
case shared.IdentityVerificationStatusV2.APPROVED:
|
|
5772
5787
|
handleClose(verificationStatus.status);
|
|
5773
5788
|
break;
|
|
5789
|
+
case shared.IdentityVerificationStatusV2.BYPASSED:
|
|
5790
|
+
handleClose(shared.IdentityVerificationStatusV2.APPROVED);
|
|
5791
|
+
break;
|
|
5774
5792
|
}
|
|
5775
5793
|
}
|
|
5776
5794
|
};
|