Skip to content

Commit

Permalink
remove window use
Browse files Browse the repository at this point in the history
  • Loading branch information
jonat75 committed Jul 29, 2024
1 parent 49d27e2 commit d762275
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/app/src/app/(default)/RedirectUrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import { useEffect } from "react";

export const RedirectedUrl = () => {
const routeur = useRouter();
const redirectedUrl = window.sessionStorage.getItem("redirectUrl");

useEffect(() => {
const redirectedUrl = window.sessionStorage.getItem("redirectUrl");
if (redirectedUrl) {
window.sessionStorage.removeItem("redirectUrl");
routeur.push(redirectedUrl);
}
}, [redirectedUrl]);
}, []);

return null;
};

0 comments on commit d762275

Please sign in to comment.