[Libreoffice-commits] online.git: loleaflet/src

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Nov 20 15:52:46 UTC 2016


 loleaflet/src/core/Socket.js |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 7f29a11bf3f78a8133d142d6c3597516ebed52f5
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Nov 20 10:45:48 2016 -0500

    loleaflet: don't show disconnection notice when inactive
    
    Users aren't bothered with connection errors when inactive.
    Instead, when they try to re-activate, the connection is
    re-established, and only if that is not possible does
    the user see the disconnection notice. Otherwise,
    the connection is re-established semi-transparently
    (the is a small "connecting" status shown at the bottom).
    
    Change-Id: If4735cc1593c6e29c65d3c9686a8f2861365c583
    Reviewed-on: https://gerrit.libreoffice.org/31026
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 41ddfb4..d88961b 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -435,6 +435,7 @@ L.Socket = L.Class.extend({
 	},
 
 	_onSocketClose: function (e) {
+		var isActive = this._map._active;
 		this._map.hideBusy();
 		this._map._active = false;
 
@@ -442,7 +443,9 @@ L.Socket = L.Class.extend({
 			this._map._docLayer.removeAllViews();
 		}
 
-		this._map.fire('error', {msg: _('Well, this is embarrassing, we cannot connect to your document. Please try again.'), cmd: 'socket', kind: 'closed', id: 4});
+		if (isActive) {
+			this._map.fire('error', {msg: _('Well, this is embarrassing, we cannot connect to your document. Please try again.'), cmd: 'socket', kind: 'closed', id: 4});
+		}
 
 		// Reset wopi's app loaded so that reconnecting again informs outerframe about initialization again
 		this._map['wopi'].resetAppLoaded();


More information about the Libreoffice-commits mailing list