collab_client: Treat RECONNECTING the same as CONNECTING
parent
02ae7f5c36
commit
67e7a822e8
|
@ -80,8 +80,9 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if ((!getSocket()) || channelState === 'CONNECTING') {
|
const connecting = ['CONNECTING', 'RECONNECTING'].includes(channelState);
|
||||||
if (channelState === 'CONNECTING' && now - startConnectTime > 20000) {
|
if (!getSocket() || connecting) {
|
||||||
|
if (connecting && now - startConnectTime > 20000) {
|
||||||
setChannelState('DISCONNECTED', 'initsocketfail');
|
setChannelState('DISCONNECTED', 'initsocketfail');
|
||||||
} else {
|
} else {
|
||||||
// check again in a bit
|
// check again in a bit
|
||||||
|
@ -355,6 +356,7 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
callbacks.onChannelStateChange(channelState, moreInfo);
|
callbacks.onChannelStateChange(channelState, moreInfo);
|
||||||
switch (channelState) {
|
switch (channelState) {
|
||||||
case 'CONNECTING':
|
case 'CONNECTING':
|
||||||
|
case 'RECONNECTING':
|
||||||
startConnectTime = Date.now();
|
startConnectTime = Date.now();
|
||||||
break;
|
break;
|
||||||
case 'CONNECTED':
|
case 'CONNECTED':
|
||||||
|
|
Loading…
Reference in New Issue