Commit 0aa8dd28 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 34014

parent 55c65cc4
...@@ -610,6 +610,11 @@ ...@@ -610,6 +610,11 @@
return this._state; return this._state;
}; };
DocsCoApi.prototype.check_state = function () {
return ConnectionState.Authorized === this._state || ConnectionState.SaveChanges === this._state ||
ConnectionState.AskSaveChanges === this._state;
};
DocsCoApi.prototype.get_indexUser = function() { DocsCoApi.prototype.get_indexUser = function() {
return this._indexUser; return this._indexUser;
}; };
...@@ -896,13 +901,13 @@ ...@@ -896,13 +901,13 @@
}; };
DocsCoApi.prototype._onMessages = function(data, clear) { DocsCoApi.prototype._onMessages = function(data, clear) {
if (ConnectionState.Authorized === this._state && data["messages"] && this.onMessage) { if (this.check_state() && data["messages"] && this.onMessage) {
this.onMessage(data["messages"], clear); this.onMessage(data["messages"], clear);
} }
}; };
DocsCoApi.prototype._onCursor = function(data) { DocsCoApi.prototype._onCursor = function(data) {
if (ConnectionState.Authorized === this._state && data["messages"] && this.onCursor) { if (this.check_state() && data["messages"] && this.onCursor) {
this.onCursor(data["messages"]); this.onCursor(data["messages"]);
} }
}; };
...@@ -914,7 +919,7 @@ ...@@ -914,7 +919,7 @@
}; };
DocsCoApi.prototype._onSession = function(data) { DocsCoApi.prototype._onSession = function(data) {
if (ConnectionState.Authorized === this._state && data["messages"] && this.onSession) { if (this.check_state() && data["messages"] && this.onSession) {
this.onSession(data["messages"]); this.onSession(data["messages"]);
} }
}; };
...@@ -945,7 +950,7 @@ ...@@ -945,7 +950,7 @@
}; };
DocsCoApi.prototype._onGetLock = function(data) { DocsCoApi.prototype._onGetLock = function(data) {
if (ConnectionState.Authorized === this._state && data["locks"]) { if (this.check_state() && data["locks"]) {
for (var key in data["locks"]) { for (var key in data["locks"]) {
if (data["locks"].hasOwnProperty(key)) { if (data["locks"].hasOwnProperty(key)) {
var lock = data["locks"][key], blockTmp = (this._isExcel || this._isPresentation) ? lock["block"]["guid"] : key, blockValue = (this._isExcel || this._isPresentation) ? lock["block"] : key; var lock = data["locks"][key], blockTmp = (this._isExcel || this._isPresentation) ? lock["block"]["guid"] : key, blockValue = (this._isExcel || this._isPresentation) ? lock["block"] : key;
...@@ -983,7 +988,7 @@ ...@@ -983,7 +988,7 @@
}; };
DocsCoApi.prototype._onReleaseLock = function(data) { DocsCoApi.prototype._onReleaseLock = function(data) {
if (ConnectionState.Authorized === this._state && data["locks"]) { if (this.check_state() && data["locks"]) {
var bSendEnd = false; var bSendEnd = false;
for (var block in data["locks"]) { for (var block in data["locks"]) {
if (data["locks"].hasOwnProperty(block)) { if (data["locks"].hasOwnProperty(block)) {
...@@ -1009,7 +1014,7 @@ ...@@ -1009,7 +1014,7 @@
}; };
DocsCoApi.prototype._onSaveChanges = function(data) { DocsCoApi.prototype._onSaveChanges = function(data) {
if (ConnectionState.Authorized !== this._state) { if (!this.check_state()) {
return; return;
} }
if (data["locks"]) { if (data["locks"]) {
...@@ -1204,7 +1209,7 @@ ...@@ -1204,7 +1209,7 @@
}; };
DocsCoApi.prototype._onConnectionStateChanged = function(data) { DocsCoApi.prototype._onConnectionStateChanged = function(data) {
if (ConnectionState.Authorized !== this._state) { if (!this.check_state()) {
return; return;
} }
var userStateChanged = null, userId, stateChanged = false, isEditUser = true; var userStateChanged = null, userId, stateChanged = false, isEditUser = true;
......
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