From 3bcac1952d63d5172b0f94ac942a723077a3d467 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 4 Sep 2024 17:59:13 +0100 Subject: [PATCH] fix getting new excuses --- src/app/page.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index be785df..598af0c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -8,12 +8,7 @@ export default function Home() { const newExcuse = () => setExcuse(createExcuse()); - useEffect(() => { - if (typeof window !== "undefined") { - window.addEventListener("beforeunload", newExcuse); - return () => window.removeEventListener("beforeunload", newExcuse); - } - }, []); + useEffect(newExcuse, []); return (