Skip to content

Commit c58e69f

Browse files
author
Adam Eberlin
committed
Fix debug flag.
1 parent d37b1b5 commit c58e69f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/assets/javascripts/sync.coffee

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ $ = jQuery
4444
isConnected: -> @adapter.isConnected()
4545

4646
onDebug: (message) ->
47+
return unless SyncConfig.debug_flag
48+
4749
window?.console?.log(message)
4850

4951
onReady: (callbacks) ->
@@ -182,7 +184,7 @@ class Sync.Stomp extends Sync.Adapter
182184
@socket = new window.SockJS(SyncConfig.websocket)
183185
@client = window.Stomp.over(@socket)
184186

185-
@client.debug = Sync.onDebug if SyncConfig.debug_flag
187+
@client.debug = Sync.onDebug
186188

187189
# SockJS does not support heart-beat: disable heart-beats
188190
@client.heartbeat.outgoing = 0
@@ -422,4 +424,6 @@ class Sync.PartialCreator
422424
partial.subscribe()
423425
partial.insert(html)
424426

427+
window.Sync = Sync
428+
425429
Sync.init()

lib/sync.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def encryption_flag
164164
end
165165

166166
def debug_flag
167-
config[:debug]
167+
!!config[:debug]
168168
end
169169

170170
def reactor

0 commit comments

Comments
 (0)