travis-web/app/routes/main.coffee
Piotr Sarnacki 90b91bd49b Fix pusher channel subscribe
When channel_prefix is not defined it should be set to empty string.
2015-02-03 20:31:41 +01:00

26 lines
708 B
CoffeeScript

#require 'pusher'
#channels = Travis.Pusher.CHANNELS
`import TravisRoute from 'travis/routes/basic'`
`import config from 'travis/config/environment'`
Route = TravisRoute.extend
renderTemplate: ->
$('body').attr('id', 'home')
@_super.apply this, arguments
@render 'repos', outlet: 'left', into: 'main'
setupController: (controller)->
# TODO: this is redundant with repositories and recent routes
toActivate = if @signedIn() then 'owned' else 'recent'
@container.lookup('controller:repos').activate(toActivate)
activate: ->
# subscribe to pusher only if we're at a main route
unless config.pro
@get('pusher').subscribeAll(['common'])
`export default Route`