Skip to content

Commit

Permalink
[ES-1368] [ES-1369] Update language.tsx and handled the Retry button …
Browse files Browse the repository at this point in the history
…functionality when the eKYC verification is unsuccessful. (#276)

* [ES-1368] Update language.tsx

Signed-off-by: Gk <[email protected]>

* [ES-1369] Handled the Retry button functionality when the eKYC verification is unsuccessful.

Signed-off-by: Gk <[email protected]>

---------

Signed-off-by: Gk <[email protected]>
  • Loading branch information
gk-4VII authored Jul 15, 2024
1 parent ddb2f2b commit 07c0640
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion signup-ui/src/components/language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import {
setErrorBannerMessageSelector,
setIsNoBackgroundSelector,
slotIdSelector,
setStepSelector,
EkycVerificationStep,
setSlotIdSelector,
useEkycVerificationStore,
} from "../useEkycVerificationStore";
import { EkycStatusAlert } from "./components/EkycStatusAlert";
Expand Down Expand Up @@ -65,6 +68,8 @@ export const VerificationScreen = ({
errorBannerMessage,
slotId,
kycProviderDetail,
setStep,
setSlotId
} = useEkycVerificationStore(
useCallback(
(state: EkycVerificationStore) => ({
Expand All @@ -73,6 +78,8 @@ export const VerificationScreen = ({
errorBannerMessage: errorBannerMessageSelector(state),
slotId: slotIdSelector(state),
kycProviderDetail: kycProviderDetailSelector(state),
setStep: setStepSelector(state),
setSlotId: setSlotIdSelector(state)
}),
[]
)
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -309,6 +322,7 @@ export const VerificationScreen = ({
getCurrentLangMsg("errors", currentStep.feedbackCode ?? "default")
);
setColorVerification(false);
setMessage(null);
break;
default:
break;
Expand Down Expand Up @@ -344,7 +358,11 @@ export const VerificationScreen = ({
),
subHeader: "Oops! We were unable to complete the eKYC verification.",
footer: (
<Button id="retry-button" className="my-4 h-16 w-full">
<Button
id="retry-button"
className="my-4 h-16 w-full"
onClick={handleRetry}
>
Retry
</Button>
),
Expand Down

0 comments on commit 07c0640

Please sign in to comment.