mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
collab_client: Always run deferred actions on connect
This commit is contained in:
parent
54a746ce94
commit
02ae7f5c36
2 changed files with 4 additions and 7 deletions
|
@ -443,7 +443,6 @@ const loadBroadcastJS = (socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
|
||||||
};
|
};
|
||||||
|
|
||||||
// to start upon window load, just push a function onto this array
|
// to start upon window load, just push a function onto this array
|
||||||
// window['onloadFuncts'].push(setUpSocket);
|
|
||||||
// window['onloadFuncts'].push(function ()
|
// window['onloadFuncts'].push(function ()
|
||||||
fireWhenAllScriptsAreLoaded.push(() => {
|
fireWhenAllScriptsAreLoaded.push(() => {
|
||||||
// set up the currentDivs and DOM
|
// set up the currentDivs and DOM
|
||||||
|
|
|
@ -148,11 +148,6 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
handleUserChanges();
|
handleUserChanges();
|
||||||
};
|
};
|
||||||
|
|
||||||
const setUpSocket = () => {
|
|
||||||
setChannelState('CONNECTED');
|
|
||||||
doDeferredActions();
|
|
||||||
};
|
|
||||||
|
|
||||||
const sendMessage = (msg) => {
|
const sendMessage = (msg) => {
|
||||||
getSocket().json.send(
|
getSocket().json.send(
|
||||||
{
|
{
|
||||||
|
@ -362,6 +357,9 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
case 'CONNECTING':
|
case 'CONNECTING':
|
||||||
startConnectTime = Date.now();
|
startConnectTime = Date.now();
|
||||||
break;
|
break;
|
||||||
|
case 'CONNECTED':
|
||||||
|
doDeferredActions();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -502,7 +500,7 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
editor.setBaseAttributedText(serverVars.initialAttributedText, serverVars.apool);
|
editor.setBaseAttributedText(serverVars.initialAttributedText, serverVars.apool);
|
||||||
editor.setUserChangeNotificationCallback(handleUserChanges);
|
editor.setUserChangeNotificationCallback(handleUserChanges);
|
||||||
|
|
||||||
setUpSocket();
|
setChannelState('CONNECTED');
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue