mirror of https://github.com/zulip/zulip.git
socket: Cancel pending auth requests on reconnect
(imported from commit 02ea7c1592ef48e2596a0dfd4830c2307a3e7df4)
This commit is contained in:
parent
002df64811
commit
cd9a44f35b
|
@ -227,6 +227,17 @@ Socket.prototype = {
|
|||
this._heartbeat_timeout_id = null;
|
||||
}
|
||||
|
||||
// Cancel any pending auth requests
|
||||
_.each(this._requests, function (val, key) {
|
||||
if (val.type === 'auth') {
|
||||
if (val.ack_timeout_id !== null) {
|
||||
clearTimeout(val.ack_timeout_id);
|
||||
val.ack_timeout_id = null;
|
||||
}
|
||||
delete that._requests[key];
|
||||
}
|
||||
});
|
||||
|
||||
this._is_open = false;
|
||||
this._is_authenticated = false;
|
||||
this._is_reconnecting = true;
|
||||
|
|
Loading…
Reference in New Issue