mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-11-14 11:03:53 +01:00
fix: preserve lobby sessions across socket reconnects
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user