1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
letu/public/javascripts/main.js
2020-11-23 21:28:17 +01:00

26 lines
No EOL
419 B
JavaScript

let socket = io.connect();
/*
Front-end Event
*/
// Disconnect
document.getElementById("logout").addEventListener("click", function() {
socket.emit("logout")
});
/*
Socket Actions
*/
// Disconnect
socket.on("logout", data=>{
if(data.error){
alert(data.error.message);
}else{
window.location.href = "/";
}
})
function profilRedirect(){
document.location.href="/profil";
}