commenting open matches

This commit is contained in:
2025-11-28 16:08:33 +05:30
parent 34e8984daa
commit 5b30ac8d83

View File

@@ -38,24 +38,24 @@ export default function TicTacToe() {
});
}, [onMatchData]);
useEffect(() => {
let active = true;
async function refreshLoop() {
while (active) {
const matches = await listOpenMatches();
setOpenMatches(matches);
await new Promise(res => setTimeout(res, 500)); // 0.5s refresh
}
}
refreshLoop();
return () => {
active = false;
};
}, [listOpenMatches]);
// useEffect(() => {
// let active = true;
//
// async function refreshLoop() {
// while (active) {
// const matches = await listOpenMatches();
// setOpenMatches(matches);
//
// await new Promise(res => setTimeout(res, 500)); // 0.5s refresh
// }
// }
//
// refreshLoop();
//
// return () => {
// active = false;
// };
// }, [listOpenMatches]);
// ------------------------------------------
// CONNECT
@@ -130,8 +130,8 @@ export default function TicTacToe() {
{/* Join matchmaking */}
<button onClick={() => startQueue(selectedMode)}>Join Matchmaking</button>
{/* List open matches */}
<MatchList matches={openMatches} />
{/*/!* List open matches *!/*/}
{/*<MatchList matches={openMatches} />*/}
</>
)}