Skip to content

Commit

Permalink
[INJIVER-601] fix:Back button from scan page is bringing the last eve…
Browse files Browse the repository at this point in the history
…nt from upload

Signed-off-by: srikanth716 <[email protected]>
  • Loading branch information
srikanth716 committed Sep 3, 2024
1 parent 2512eaa commit a81a75b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions inji-verify/src/pages/OvpRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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(
{
Expand Down

0 comments on commit a81a75b

Please sign in to comment.