Version 0.9.0c - Ajout du Home Menu V2

This commit is contained in:
CICD - Pipeline 2023-09-11 22:20:44 +02:00
parent 7fe2add7a3
commit 4457329159
2 changed files with 23 additions and 7 deletions

View File

@ -185,16 +185,18 @@ function IOConnection(io) {
var utoken = ucookies.token var utoken = ucookies.token
const online_users_data = auth.getSimpleUser(utoken) const online_users_data = auth.getSimpleUser(utoken)
if(online_users_data) {
usersOnline.push(online_users_data)
}
usersOnline.push(online_users_data)
alog.log(online_users_data.username + " - Connexion du serveur")
} }
io.sockets.emit("ALWAYS/ALL_CONNECTED_USER", usersOnline) io.sockets.emit("ALWAYS/ALL_CONNECTED_USER", usersOnline)
wlog.log("[SOCKET] - Nouvelle session : " + socket.id)
wlog.log("[SOCKET] - Nouvelle session : " + socket.id)
@ -205,10 +207,22 @@ function IOConnection(io) {
var utoken = ucookies.token var utoken = ucookies.token
const online_users_data = auth.getSimpleUser(utoken) const online_users_data = auth.getSimpleUser(utoken)
if(online_users_data) {
usersOnline.splice(usersOnline.indexOf(online_users_data), 1) var userIndex = -1
for(var user of usersOnline) {
if(user.username == online_users_data.username) {
userIndex = usersOnline.indexOf(user)
}
} }
alog.log(online_users_data.username + " - Deconnexion du serveur")
usersOnline.splice(userIndex, 1)
} }
io.sockets.emit("ALWAYS/ALL_CONNECTED_USER", usersOnline) io.sockets.emit("ALWAYS/ALL_CONNECTED_USER", usersOnline)

View File

@ -138,6 +138,8 @@ homeBtn.addEventListener("click", () => {
function loadHome() { function loadHome() {
wasOnHome = true
mainView.innerHTML = WelcomeContent mainView.innerHTML = WelcomeContent
wasOnPlaylist = false wasOnPlaylist = false