diff --git a/src/pages/UserVerification.tsx b/src/pages/UserVerification.tsx index fb62e1b..7ee7d71 100644 --- a/src/pages/UserVerification.tsx +++ b/src/pages/UserVerification.tsx @@ -55,7 +55,7 @@ const UserVerification = () => { }, [applicationSubmitted, kycId, navigate, cosmosAddress, message, receivedEthSig]); const messageHandler: MessageHandler = (event, payload) => { - console.log('sumsubEvent:', event); + console.log('sumsubEvent:', event, payload); if (event === 'idCheck.onApplicantLoaded') { setKycId((payload as EventPayload<'idCheck.onApplicantLoaded'>).applicantId); @@ -66,9 +66,12 @@ const UserVerification = () => { } if (event === 'idCheck.onApplicantStatusChanged') { - if ((payload as EventPayload<'idCheck.onApplicantStatusChanged'>).reviewStatus === 'pending') { + const applicantStatus = (payload as EventPayload<'idCheck.onApplicantStatusChanged'>).reviewStatus; + + if (applicantStatus === 'pending' || applicantStatus === 'completed') { setApplicationSubmitted(true); } + if ((payload as any).reviewResult.reviewAnswer === 'GREEN') { setApplicationSubmitted(true); }