Update conversation.html

This commit is contained in:
2025-05-27 16:43:40 +02:00
parent 348a1dd601
commit d76bee84f9

View File

@@ -407,16 +407,16 @@ if (typeof window.ChatManager === 'undefined') {
transports: ['polling', 'websocket'],
upgrade: true,
reconnection: true,
reconnectionAttempts: Infinity,
reconnectionAttempts: 5,
reconnectionDelay: 1000,
reconnectionDelayMax: 5000,
timeout: 20000,
autoConnect: true,
timeout: 10000,
autoConnect: false, // Don't connect automatically
forceNew: true,
multiplex: false,
pingTimeout: 60000,
pingInterval: 25000,
upgradeTimeout: 10000,
pingTimeout: 30000,
pingInterval: 10000,
upgradeTimeout: 5000,
rememberUpgrade: true,
rejectUnauthorized: false,
extraHeaders: {
@@ -446,6 +446,12 @@ if (typeof window.ChatManager === 'undefined') {
state.connectionState.hasJoined = true;
});
// Connect only when the page is fully loaded
$(window).on('load', function() {
console.log('Page loaded, connecting socket...');
socket.connect();
});
socket.on('disconnect', function(reason) {
console.log('Disconnected from conversation:', {
reason: reason,