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

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Sat Dec 14 17:27:17 UTC 2019


 loleaflet/src/core/Socket.js |   24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

New commits:
commit 3a0172f5f9687200ad261bf62f11defaa875d5e7
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Sat Dec 14 17:26:01 2019 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Dec 14 17:26:01 2019 +0000

    re-connect after idle timeout properly.
    
    Another horror caused by some unexpected vex change, now we listen
    for afterClose to be sure that when the dialog is gone we started to
    try to re-connect.
    
    Change-Id: Ic053df665d188f25f6ddf3b081433bbd6dd37820

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 706234980..653b71366 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -453,18 +453,30 @@ L.Socket = L.Class.extend({
 				message = msg;
 			}
 
-			var dialogOpened = vex.dialog.open({
+			var dialogOptions = {
 				message: message,
 				contentClassName: 'loleaflet-user-idle'
-			});
+			};
 
+			var restartConnectionFn;
 			if (textMsg === 'idle' || textMsg === 'oom') {
 				var map = this._map;
-				dialogOpened.contentEl.onclick = function() {
-					console.debug('idleness: reactivating');
-					map._documentIdle = false;
-					return map._activate();
+				restartConnectionFn = function() {
+					if (map._documentIdle)
+					{
+						console.debug('idleness: reactivating');
+						map._documentIdle = false;
+						return map._activate();
+					}
+					return false;
 				};
+				dialogOptions.afterClose = restartConnectionFn;
+			}
+
+			var dialogOpened = vex.dialog.open(dialogOptions);
+
+			if (textMsg === 'idle' || textMsg === 'oom') {
+				dialogOpened.contentEl.onclick = restartConnectionFn;
 				$('.vex-overlay').addClass('loleaflet-user-idle-overlay');
 			}
 


More information about the Libreoffice-commits mailing list