From a81a75bc5faa2d44574bd05fa4588e87044fb826 Mon Sep 17 00:00:00 2001 From: srikanth716 Date: Tue, 3 Sep 2024 18:58:46 +0530 Subject: [PATCH] [INJIVER-601] fix:Back button from scan page is bringing the last event from upload Signed-off-by: srikanth716 --- inji-verify/src/pages/OvpRedirect.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/inji-verify/src/pages/OvpRedirect.tsx b/inji-verify/src/pages/OvpRedirect.tsx index ac61f9b3..8c4d4386 100644 --- a/inji-verify/src/pages/OvpRedirect.tsx +++ b/inji-verify/src/pages/OvpRedirect.tsx @@ -13,9 +13,9 @@ function OvpRedirect(props: any) { const dispatch = useAppDispatch(); useEffect(() => { - let vpToken, presentationSubmission, error, errorDescription; + let vpToken, presentationSubmission, params, error, errorDescription; try { - const params = new URLSearchParams(location.hash.substring(1)); + params = new URLSearchParams(location.hash.substring(1)); const queryParams = new URLSearchParams(location.search.substring(1)); vpToken = !!params.get("vp_token") @@ -32,9 +32,11 @@ function OvpRedirect(props: any) { console.error("Error occurred while reading params in redirect url, Error: ", error); } finally { - navigate(Pages.Home); if (!!vpToken && !!presentationSubmission) { dispatch(verificationInit({ovp: {vpToken, presentationSubmission}})); + params?.delete("vp_token"); + params?.delete("presentation_submission"); + navigate(Pages.Home, { replace: true }); } else if (!!error) { dispatch(raiseAlert( {