Site
- disable cha when user is not connected
This commit is contained in:
@ -77,6 +77,7 @@
|
||||
<h2>X</h2>
|
||||
</div>
|
||||
</div>
|
||||
<p id="infoChat">You are not connected to the chat</p>
|
||||
</div>
|
||||
<section class="homeSection">
|
||||
</section>
|
||||
|
@ -3,10 +3,10 @@
|
||||
/* ::: :::::::: */
|
||||
/* main.js :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: madegryc <madegryc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/25 00:02:19 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/17 17:21:27 by madegryc ### ########.fr */
|
||||
/* Updated: 2024/09/17 23:02:03 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -6,13 +6,14 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/04 19:19:10 by edbernar #+# #+# */
|
||||
/* Updated: 2024/08/25 18:26:52 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/17 23:10:22 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
import { infoPanel } from "/static/javascript/typeResponse/typePrivateListMessage.js";
|
||||
import { showActualGameMessage } from "/static/javascript/liveChat/showActualGameMessage.js";
|
||||
import { showListUser } from "/static/javascript/liveChat/showUserList.js";
|
||||
import { userMeInfo } from "/static/javascript/typeResponse/typeLogin.js";
|
||||
|
||||
/*
|
||||
Todo (Eddy) :
|
||||
@ -20,6 +21,7 @@ import { showListUser } from "/static/javascript/liveChat/showUserList.js";
|
||||
- game message when game will be implemented
|
||||
*/
|
||||
|
||||
let chatContent = null;
|
||||
let chatButton = null;
|
||||
let topChatHomeCross = null;
|
||||
|
||||
@ -86,14 +88,22 @@ function removeButtonIfExist()
|
||||
|
||||
async function showChatMenu()
|
||||
{
|
||||
const infoChat = document.getElementById("infoChat");
|
||||
|
||||
chatDiv.style.display = "flex";
|
||||
removeButtonIfExist();
|
||||
addDefaultButton();
|
||||
await showListUser();
|
||||
if (userMeInfo.id !== -1)
|
||||
{
|
||||
if (infoChat)
|
||||
infoChat.remove();
|
||||
removeButtonIfExist();
|
||||
addDefaultButton();
|
||||
await showListUser();
|
||||
}
|
||||
}
|
||||
|
||||
function hideChatMenu()
|
||||
{
|
||||
console.log("hideChatMenu");
|
||||
chatDiv.style.display = "none";
|
||||
infoPanel.isOpen = false;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/02 00:39:53 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/14 23:59:52 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/17 22:52:44 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -23,7 +23,7 @@ let loginResolve = null;
|
||||
function waitForLogin() {
|
||||
return new Promise((resolve) => {
|
||||
if (loginAvailable)
|
||||
resolve();
|
||||
resolve(userMeInfo);
|
||||
else
|
||||
loginResolve = resolve;
|
||||
});
|
||||
@ -58,7 +58,6 @@ function typeLogin(content)
|
||||
{
|
||||
loginResolve(content);
|
||||
loginResolve = null;
|
||||
loginAvailable = false;
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
@ -3,10 +3,10 @@
|
||||
/* ::: :::::::: */
|
||||
/* liveChat.css :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: madegryc <madegryc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/30 13:53:39 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/17 18:04:08 by madegryc ### ########.fr */
|
||||
/* Updated: 2024/09/17 23:12:39 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -238,3 +238,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
#infoChat {
|
||||
text-align: center;
|
||||
margin-top: 100px;
|
||||
}
|
Reference in New Issue
Block a user