Navigate user if review status is completed
This commit is contained in:
parent
9dfc15a840
commit
ae49e6ff11
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user