Versie 1.0
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
(() => {
|
||||
const logoutLink = document.querySelector('a[href="/logout"]');
|
||||
if (!logoutLink) return;
|
||||
|
||||
const socket = window.io && window.io();
|
||||
if (!socket) return;
|
||||
|
||||
logoutLink.addEventListener("click", (event) => {
|
||||
event.preventDefault();
|
||||
socket.disconnect();
|
||||
window.location.assign(logoutLink.href);
|
||||
});
|
||||
|
||||
const listMatch = window.location.pathname.match(/^\/lists\/(\d+)$/);
|
||||
if (listMatch) socket.emit("list:join", listMatch[1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user