travis-web/app/views/builds.coffee
Piotr Sarnacki a4a75912b0 Implement ajax polling for things that are visible on the screen
We sometimes miss pusher updates, which started to be more common
lately. Until we investigate what's going on, this should be a good
workaround for keeping UI in sync with the DB.
2015-05-07 13:49:21 +02:00

19 lines
626 B
CoffeeScript

`import BasicView from 'travis/views/basic'`
`import Polling from 'travis/mixins/polling'`
View = BasicView.extend Polling,
pollHook: (store) ->
contentType = @get('controller.contentType')
repositoryId = @get('controller.repo.id')
store = @get('controller.store')
if contentType == 'builds'
store.find('build', { event_type: 'push', repository_id: repositoryId })
else if contentType == 'pull_requests'
store.filter('build', { event_type: 'pull_request', repository_id: repositoryId })
else
store.find 'build', repository_id: repositoryId, branches: true
`export default View`