fix: preserve lobby sessions across socket reconnects

This commit is contained in:
2026-10-21 15:23:19 -04:00
parent 2e85adffde
commit 0244a4ab8c
3 changed files with 198 additions and 8 deletions
+3
View File
@@ -156,6 +156,8 @@ const SocketHandlers = {
// If the low-level socket connected before handlers were registered, emulate onConnect.
if (window.socket && window.socket.connected) {
this.onConnect();
} else if (window.socket && typeof window.socket.connect === 'function') {
window.socket.connect();
}
},
@@ -183,6 +185,7 @@ const SocketHandlers = {
// Connection handlers
socket.on('connect', this.onConnect);
socket.on('disconnect', function() {
SocketHandlers._didConnect = false;
SocketHandlers._invalidatePaymentSession();
if (typeof CommerceConsent !== 'undefined' && CommerceConsent.clear) {
CommerceConsent.clear();