Skip to content

Commit

Permalink
easy
Browse files Browse the repository at this point in the history
  • Loading branch information
pesto13 committed Sep 22, 2024
1 parent 881bc1a commit 7c94aae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Scoprimi/src/components/lobby/Lobby.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const Lobby: React.FC = () => {
// setlog(log + `DOCUMENT.hidden: ${document.hidden}\n`);
setIsPageVisible(!document.hidden);
if (!document.hidden) {
setIsPageVisible(!document.hidden);
const data = {
lobbyCode: currentLobby,
playerName: currentPlayer,
Expand All @@ -44,7 +45,7 @@ const Lobby: React.FC = () => {
const timer = setTimeout(() => {
// setlog(log + 'sto per lanciare evento\n');
setLoading(false);
}, 3000);
}, 5000);

// Pulizia del timer se la pagina diventa non visibile prima del timeout
return () => clearTimeout(timer);
Expand Down

0 comments on commit 7c94aae

Please sign in to comment.