Commit 4124f8bf authored by konovalovsergey's avatar konovalovsergey

fix issue: when first of two editor lost connection and quickly reconnect,...

fix issue: when first of two editor lost connection and quickly reconnect, second receive 'connectState' in wrong order 'connect' and then 'close' and break _countEditUsers variable. as result first get forever waitAuth on page reload.
parent 3b71c683
......@@ -1080,14 +1080,14 @@
userId = userStateChanged.asc_getId();
isEditUser = !userStateChanged.asc_getView();
if (userStateChanged.asc_getState()) {
if (userStateChanged.asc_getState() && !this._participants.hasOwnProperty(userId)) {
this._participants[userId] = userStateChanged;
++this._countUsers;
if (isEditUser) {
++this._countEditUsers;
}
stateChanged = true;
} else if (this._participants.hasOwnProperty(userId)) {
} else if (!userStateChanged.asc_getState() && this._participants.hasOwnProperty(userId)) {
delete this._participants[userId];
--this._countUsers;
if (isEditUser) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment