From 07c06409947322a2b533b984b1169d5760af7b74 Mon Sep 17 00:00:00 2001 From: Gk <76690271+gk-4VII@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:05:47 +0530 Subject: [PATCH] [ES-1368] [ES-1369] Update language.tsx and handled the Retry button functionality when the eKYC verification is unsuccessful. (#276) * [ES-1368] Update language.tsx Signed-off-by: Gk <76690271+gk-4VII@users.noreply.github.com> * [ES-1369] Handled the Retry button functionality when the eKYC verification is unsuccessful. Signed-off-by: Gk <76690271+gk-4VII@users.noreply.github.com> --------- Signed-off-by: Gk <76690271+gk-4VII@users.noreply.github.com> --- signup-ui/src/components/language.tsx | 2 +- .../VerificationScreen/VerificationScreen.tsx | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/signup-ui/src/components/language.tsx b/signup-ui/src/components/language.tsx index 70f4ecad..6fad6f8c 100644 --- a/signup-ui/src/components/language.tsx +++ b/signup-ui/src/components/language.tsx @@ -33,7 +33,7 @@ export const Language = () => { // Encode the string const encodedBase64 = btoa(urlSearchParams.toString()); const url = - window.location.origin + window.location.pathname + "#" + encodedBase64; + window.location.origin + window.location.pathname + window.location.search + "#" + encodedBase64; // Replace the current url with the modified url due to the language change window.history.replaceState(null, "", url); diff --git a/signup-ui/src/pages/EkycVerificationPage/VerificationScreen/VerificationScreen.tsx b/signup-ui/src/pages/EkycVerificationPage/VerificationScreen/VerificationScreen.tsx index 938d0857..5525d399 100644 --- a/signup-ui/src/pages/EkycVerificationPage/VerificationScreen/VerificationScreen.tsx +++ b/signup-ui/src/pages/EkycVerificationPage/VerificationScreen/VerificationScreen.tsx @@ -26,6 +26,9 @@ import { setErrorBannerMessageSelector, setIsNoBackgroundSelector, slotIdSelector, + setStepSelector, + EkycVerificationStep, + setSlotIdSelector, useEkycVerificationStore, } from "../useEkycVerificationStore"; import { EkycStatusAlert } from "./components/EkycStatusAlert"; @@ -65,6 +68,8 @@ export const VerificationScreen = ({ errorBannerMessage, slotId, kycProviderDetail, + setStep, + setSlotId } = useEkycVerificationStore( useCallback( (state: EkycVerificationStore) => ({ @@ -73,6 +78,8 @@ export const VerificationScreen = ({ errorBannerMessage: errorBannerMessageSelector(state), slotId: slotIdSelector(state), kycProviderDetail: kycProviderDetailSelector(state), + setStep: setStepSelector(state), + setSlotId: setSlotIdSelector(state) }), [] ) @@ -136,6 +143,12 @@ export const VerificationScreen = ({ publish(PUBLISH_TOPIC, JSON.stringify(request)); }; + const handleRetry = (e: any) => { + e.preventDefault(); + setSlotId(null); + setStep(EkycVerificationStep.SlotCheckingScreen); + }; + // timer useEffect useEffect(() => { if (timer && timer > 0) { @@ -309,6 +322,7 @@ export const VerificationScreen = ({ getCurrentLangMsg("errors", currentStep.feedbackCode ?? "default") ); setColorVerification(false); + setMessage(null); break; default: break; @@ -344,7 +358,11 @@ export const VerificationScreen = ({ ), subHeader: "Oops! We were unable to complete the eKYC verification.", footer: ( - ),