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