loleaflet: Socket.connected() to report socket connection state
Change-Id: Ib777f1af52dac518ceae7234334af4108943fc07 Reviewed-on: https://gerrit.libreoffice.org/24350 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
parent
2fc74ee650
commit
381badc3cb
1 changed files with 4 additions and 0 deletions
|
@ -30,6 +30,10 @@ L.Socket = L.Class.extend({
|
|||
this.socket.close();
|
||||
},
|
||||
|
||||
connected: function() {
|
||||
return this.socket && this.socket.readyState === 1;
|
||||
},
|
||||
|
||||
sendMessage: function (msg, coords) {
|
||||
if (!msg.startsWith('useractive') && !msg.startsWith('userinactive') && !this._active) {
|
||||
// Avoid communicating when we're inactive.
|
||||
|
|
Loading…
Reference in a new issue