Skip to content

Commit

Permalink
fix getting new excuses
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpepler committed Sep 4, 2024
1 parent 2ed316d commit 3bcac19
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<main className={styles.main}>
Expand Down

0 comments on commit 3bcac19

Please sign in to comment.