|
|
@ -28,7 +28,7 @@ class LobbyDataProps {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// let cptNavigation = 0
|
|
|
|
let cptNavigation = 0
|
|
|
|
|
|
|
|
|
|
|
|
function Lobbies() {
|
|
|
|
function Lobbies() {
|
|
|
|
const theme=useTheme();
|
|
|
|
const theme=useTheme();
|
|
|
@ -42,7 +42,7 @@ function Lobbies() {
|
|
|
|
|
|
|
|
|
|
|
|
const [showAvailable, setShowAvailable] = useState(true);
|
|
|
|
const [showAvailable, setShowAvailable] = useState(true);
|
|
|
|
|
|
|
|
|
|
|
|
const [cptNavigation, setCptNavigation] = useState(0);
|
|
|
|
//const [cptNavigation, setCptNavigation] = useState(0);
|
|
|
|
|
|
|
|
|
|
|
|
const handleShowAllClick = () => {
|
|
|
|
const handleShowAllClick = () => {
|
|
|
|
setShowAvailable(false);
|
|
|
|
setShowAvailable(false);
|
|
|
@ -58,9 +58,9 @@ function Lobbies() {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleSetCptNavigation = () => {
|
|
|
|
const handleSetCptNavigation = () => {
|
|
|
|
setCptNavigation((prevCpt) => prevCpt + 1);
|
|
|
|
//setCptNavigation((prevCpt) => prevCpt + 1);
|
|
|
|
|
|
|
|
|
|
|
|
if (cptNavigation % 2 === 0 && navigationType.toString() === "POP") {
|
|
|
|
if (cptNavigation % 2 >= 0 && navigationType.toString() === "POP") {
|
|
|
|
socket.emit("player quit");
|
|
|
|
socket.emit("player quit");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -86,7 +86,8 @@ function Lobbies() {
|
|
|
|
handleSetCptNavigation();
|
|
|
|
handleSetCptNavigation();
|
|
|
|
|
|
|
|
|
|
|
|
if (first){
|
|
|
|
if (first){
|
|
|
|
handleSetFirst();
|
|
|
|
setFirst(false)
|
|
|
|
|
|
|
|
socket.emit("request lobbies")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|