summaryrefslogtreecommitdiff
path: root/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'javascripts')
-rw-r--r--javascripts/dashing.coffee9
1 files changed, 6 insertions, 3 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee
index ee4b6d4..235a965 100644
--- a/javascripts/dashing.coffee
+++ b/javascripts/dashing.coffee
@@ -94,12 +94,15 @@ Dashing.debugMode = false
source = new EventSource('events')
source.addEventListener 'open', (e) ->
- console.log("Connection opened")
+ console.log("Connection opened", e)
source.addEventListener 'error', (e)->
- console.log("Connection error")
- if (e.readyState == EventSource.CLOSED)
+ console.log("Connection error", e)
+ if (e.currentTarget.readyState == EventSource.CLOSED)
console.log("Connection closed")
+ setTimeout (->
+ window.location.reload()
+ ), 10000
source.addEventListener 'message', (e) ->
data = JSON.parse(e.data)