poprawki bugow i dodatkowe funkcje
This commit is contained in:
@ -1,5 +1,28 @@
|
||||
const socket = io();
|
||||
|
||||
|
||||
// --- Automatyczny reconnect po powrocie do karty/przywróceniu internetu ---
|
||||
function reconnectIfNeeded() {
|
||||
if (!socket.connected) {
|
||||
socket.connect();
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("visibilitychange", function() {
|
||||
if (!document.hidden) {
|
||||
reconnectIfNeeded();
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener("focus", function() {
|
||||
reconnectIfNeeded();
|
||||
});
|
||||
|
||||
window.addEventListener("online", function() {
|
||||
reconnectIfNeeded();
|
||||
});
|
||||
// --- koniec fragmentu reconnect ---
|
||||
|
||||
function setupList(listId, username) {
|
||||
socket.emit('join_list', { room: listId, username: username });
|
||||
|
||||
|
Reference in New Issue
Block a user