- add function for open profil in home page
    - remove button newConv if own profile page
    - add message in page if we try to access to METH when we are already connected
This commit is contained in:
Kum1ta
2024-09-22 23:50:11 +02:00
parent 183c487ff6
commit aee57affaa
6 changed files with 56 additions and 17 deletions

View File

@ -6,13 +6,14 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/07 17:40:15 by edbernar #+# #+# */
/* Updated: 2024/09/18 21:51:14 by edbernar ### ########.fr */
/* Updated: 2024/09/22 23:44:49 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
import { createNotification as CN } from "/static/javascript/notification/main.js";
import { userMeInfo, waitForLogin } from "/static/javascript/typeResponse/typeLogin.js";
import { createNotification as CN } from "/static/javascript/notification/main.js";
import { sendRequest } from "/static/javascript/websocket.js";
import { pageRenderer } from '/static/javascript/main.js'
class Login
{
@ -121,6 +122,9 @@ function initButtonPopMenuLogin()
{
const buttons = document.getElementById('popMenuLoginButton').getElementsByTagName('p');
buttons[0].addEventListener('click', () => {
pageRenderer.changePage('profilPage', false, userMeInfo.id);
});
buttons[2].addEventListener('click', () => {
window.location.replace('/logout');
})