From 6d86cc649af4c22341b66f1a43a9b7550629b973 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 28 Feb 2013 01:36:05 +0100 Subject: [PATCH] Fixed fallback to longbolling. --- app/assets/javascripts/app/lib/app_post/websocket.js.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 1903b88fb..f471d6baa 100644 --- a/app/assets/javascripts/app/lib/app_post/websocket.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/websocket.js.coffee @@ -41,6 +41,7 @@ class _Singleton extends App.Controller lastSpoolMessage: undefined connectionEstablished: false connectionWasEstablished: false + tryToConnect: false backend: 'websocket' client_id: undefined @@ -201,7 +202,9 @@ class _Singleton extends App.Controller @error = new App.ErrorModal( message: 'No connection to websocket, trying to reconnect...' ) - @delay message, 7000, 'websocket-no-connection-try-reconnect' + if !@tryToConnect + @delay message, 7000, 'websocket-no-connection-try-reconnect' + @tryToConnect = true # try reconnect after 4.5 sec. @delay @connect, 4500