From d668fc7d6cdfa3c617ddfbcb399d85a4175f9451 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 19 Jun 2013 10:22:26 +0200 Subject: [PATCH] Improved error message if network connection got lost. --- .../app/lib/app_post/websocket.js.coffee | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/websocket.js.coffee b/app/assets/javascripts/app/lib/app_post/websocket.js.coffee index b15ca773e..7a70a067e 100644 --- a/app/assets/javascripts/app/lib/app_post/websocket.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/websocket.js.coffee @@ -147,7 +147,7 @@ class _Singleton extends App.Controller check = => @log 'Websocket', 'notice', 'no websockend ping response, reconnect...' @close() - @delay check, 120000, 'websocket-ping-check', 'ws' + @delay check, 90000, 'websocket-ping-check', 'ws' pong: -> return if @backend is 'ajax' @@ -183,7 +183,8 @@ class _Singleton extends App.Controller @clearDelay('websocket-no-connection-try-reconnect') if @error @error.modalHide() - @error = undefined + @error = false + @tryToConnect = false @auth() @@ -202,7 +203,7 @@ class _Singleton extends App.Controller @_receiveMessage(pipe) @ws.onclose = (e) => - @log 'Websocket', 'debug', "ws:onclose", e + @log 'Websocket', 'notice', 'close websocket connection' # take connection down and keep it down return if @connectionKeepDown @@ -226,8 +227,12 @@ class _Singleton extends App.Controller return # show reconnect message - @error = new App.ErrorModal( - message: 'No connection to websocket, trying to reconnect...' + @error = new App.ControllerModal( + title: 'Lost network connection!' + message: 'Lost network connection to system, trying to reconnect...' + backdrop: false + keyboard: false + show: true ) if !@tryToConnect @delay message, 7000, 'websocket-no-connection-try-reconnect-message', 'ws'