From ab5b6b895536c504cad7137467806c5e4a2f54e3 Mon Sep 17 00:00:00 2001 From: Terje Karlsen Date: Tue, 19 Dec 2023 10:54:14 +0100 Subject: [PATCH] =?UTF-8?q?Fikser=20feil=20i=20h=C3=A5ndtering=20av=20Esca?= =?UTF-8?q?pe-press?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/komponenter/header/logoutWarning/LogoutWarning.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/komponenter/header/logoutWarning/LogoutWarning.tsx b/src/komponenter/header/logoutWarning/LogoutWarning.tsx index 21a002251..1b6c8e981 100644 --- a/src/komponenter/header/logoutWarning/LogoutWarning.tsx +++ b/src/komponenter/header/logoutWarning/LogoutWarning.tsx @@ -31,11 +31,7 @@ export const LogoutWarning = () => { } window.addEventListener('keydown', onKeydownHandler); - - return () => { - window.removeEventListener('keydown', onKeydownHandler); - }; - }, []); + }, [dialogRef.current]); useEffect(() => { if (isTokenExpiring || isSessionExpiring) {