mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 08:56:17 -04:00
collab_client: Delete unused deferred action tag
This commit is contained in:
parent
67e7a822e8
commit
5814b76aa4
1 changed files with 4 additions and 13 deletions
|
@ -377,11 +377,10 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
// is connected for the first time.
|
// is connected for the first time.
|
||||||
let deferredActions = [];
|
let deferredActions = [];
|
||||||
|
|
||||||
const defer = (func, tag) => function (...args) {
|
const defer = (func) => function (...args) {
|
||||||
const action = () => {
|
const action = () => {
|
||||||
func.call(this, ...args);
|
func.call(this, ...args);
|
||||||
};
|
};
|
||||||
action.tag = tag;
|
|
||||||
if (channelState !== 'CONNECTED') {
|
if (channelState !== 'CONNECTED') {
|
||||||
deferredActions.push(action);
|
deferredActions.push(action);
|
||||||
} else {
|
} else {
|
||||||
|
@ -389,17 +388,9 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const doDeferredActions = (tag) => {
|
const doDeferredActions = () => {
|
||||||
const newArray = [];
|
for (const action of deferredActions) action();
|
||||||
for (let i = 0; i < deferredActions.length; i++) {
|
deferredActions = [];
|
||||||
const a = deferredActions[i];
|
|
||||||
if ((!tag) || (tag === a.tag)) {
|
|
||||||
a();
|
|
||||||
} else {
|
|
||||||
newArray.push(a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
deferredActions = newArray;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendClientMessage = (msg) => {
|
const sendClientMessage = (msg) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue