loleaflet/src/core/Socket.js |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 133d36b9b8e313528318758d01936deef41db6fa
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Wed Apr 25 17:23:03 2018 +0200

    SendMessage needs to accept Blob too.
    
    Make the condition more readable when at that.
    
    Change-Id: Ibcabfc2b57eb4ebd8f1ad8bb5ee71010e52e8e3c
    Reviewed-on: https://gerrit.libreoffice.org/53525
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Tested-by: Michael Meeks <michael.me...@collabora.com>

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index ce05a4a6d..ad654fc57 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -84,12 +84,20 @@ L.Socket = L.Class.extend({
        },
 
        sendMessage: function (msg, coords) {
-               if ((!msg.startsWith('useractive') && 
!msg.startsWith('userinactive') && !this._map._active) ||
-                   this._map._fatal) {
-                       // Avoid communicating when we're inactive.
+               if (this._map._fatal) {
+                       // Avoid communicating when we're in fatal state
                        return;
                }
 
+               if (!this._map._active) {
+                       // Avoid communicating when we're inactive.
+                       if (typeof msg !== 'string')
+                               return;
+
+                       if (!msg.startsWith('useractive') && 
!msg.startsWith('userinactive'))
+                               return;
+               }
+
                var socketState = this.socket.readyState;
                if (socketState === 2 || socketState === 3) {
                        this._map.loadDocument();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to