From d762275e7f85fbe2ede2d88f361208bdc7a622a7 Mon Sep 17 00:00:00 2001 From: Jonathan Perrault Date: Mon, 29 Jul 2024 09:40:21 +0200 Subject: [PATCH] remove window use --- packages/app/src/app/(default)/RedirectUrl.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/app/src/app/(default)/RedirectUrl.tsx b/packages/app/src/app/(default)/RedirectUrl.tsx index a21f5b7be..e1ab9b84c 100644 --- a/packages/app/src/app/(default)/RedirectUrl.tsx +++ b/packages/app/src/app/(default)/RedirectUrl.tsx @@ -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; };