Skip to content

Commit

Permalink
refactor: remove unused beforeunload event listener in BuddyMatcher c…
Browse files Browse the repository at this point in the history
…omponent
  • Loading branch information
tasosbeast committed Jan 31, 2025
1 parent 02a9799 commit b600e1d
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions client/src/components/BuddyMatcher.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ const BuddyMatcher = () => {
};
}, []); // Empty dependency array since handleBeforeUnload doesn't depend on props/state

useEffect(() => {
// Add event listener for beforeunload
window.addEventListener('beforeunload', handleBeforeUnload);

return () => {
// Cleanup event listener
window.removeEventListener('beforeunload', handleBeforeUnload);
};
}, []);

async function handleReconnect() {
if (socket.connected) {
return;
Expand Down

0 comments on commit b600e1d

Please sign in to comment.