catch pusher unsubscribe exceptions
This commit is contained in:
parent
b33f4d88aa
commit
060812b65d
|
@ -13,13 +13,15 @@ $.extend Travis.Pusher.prototype,
|
|||
subscribe: (channel) ->
|
||||
if @pusher && @active_channels.indexOf(channel) == -1
|
||||
@active_channels.push(channel)
|
||||
@pusher.subscribe(@prefix(channel)).bind_all (event, data) => @receive(event, data)
|
||||
@pusher.subscribe(@prefix(channel)).bind_all(event, data) => @receive(event, data)
|
||||
|
||||
unsubscribe: (channel) ->
|
||||
ix = @active_channels.indexOf(channel)
|
||||
if @pusher && ix == -1
|
||||
@active_channels.splice(ix, 1)
|
||||
@pusher.unsubscribe(@prefix(channel))
|
||||
try
|
||||
@pusher.unsubscribe(@prefix(channel))
|
||||
catch e
|
||||
|
||||
prefix: (channel) ->
|
||||
"#{Travis.Pusher.CHANNEL_PREFIX}#{channel}"
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user