Skip to content

Commit

Permalink
gfh
Browse files Browse the repository at this point in the history
  • Loading branch information
codergautam committed Oct 15, 2024
1 parent b191c9f commit 854758f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,17 @@ export default function Home({ }) {
}
}, [JSON.stringify(mainSession), inCrazyGames])

useEffect(() => {
window.onbeforeunload = function(e) {
if(screen === "home") {
// this breaks stuff like logout and set username reloads
// useEffect(() => {
// window.onbeforeunload = function(e) {
// if(screen === "home") {

} else {
e.preventDefault();
return e.returnValue = 'Are you sure you want to leave?';
}
}
}, [screen])
// } else {
// e.preventDefault();
// return e.returnValue = 'Are you sure you want to leave?';
// }
// }
// }, [screen])



Expand Down

0 comments on commit 854758f

Please sign in to comment.