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

New commits:
commit 3a0172f5f9687200ad261bf62f11defaa875d5e7
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Sat Dec 14 17:26:01 2019 +0000
Commit:     Michael Meeks <michael.me...@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');
                        }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to