collab_client: Delete unused deferred action `tag`

rhansen-collab_client
Richard Hansen 2021-03-30 17:22:46 -04:00
parent 67e7a822e8
commit 5814b76aa4
1 changed files with 4 additions and 13 deletions

View File

@ -377,11 +377,10 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
// is connected for the first time.
let deferredActions = [];
const defer = (func, tag) => function (...args) {
const defer = (func) => function (...args) {
const action = () => {
func.call(this, ...args);
};
action.tag = tag;
if (channelState !== 'CONNECTED') {
deferredActions.push(action);
} else {
@ -389,17 +388,9 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
}
};
const doDeferredActions = (tag) => {
const newArray = [];
for (let i = 0; i < deferredActions.length; i++) {
const a = deferredActions[i];
if ((!tag) || (tag === a.tag)) {
a();
} else {
newArray.push(a);
}
}
deferredActions = newArray;
const doDeferredActions = () => {
for (const action of deferredActions) action();
deferredActions = [];
};
const sendClientMessage = (msg) => {