From ae49e6ff11577a4b15810e1dd8dad43334a3b63d Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 30 Jul 2024 17:34:24 +0530 Subject: [PATCH] Navigate user if review status is completed --- src/pages/UserVerification.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); }