diff --git a/app/controllers/build.coffee b/app/controllers/build.coffee index 6ce36f33..1f86f62c 100644 --- a/app/controllers/build.coffee +++ b/app/controllers/build.coffee @@ -8,6 +8,7 @@ Controller = Ember.Controller.extend GithubUrlPropertievs, commitBinding: 'build.commit' currentUserBinding: 'controllers.repo.currentUser' tabBinding: 'controllers.repo.tab' + sendFaviconStateChanges: true currentItemBinding: 'build' @@ -24,7 +25,8 @@ Controller = Ember.Controller.extend GithubUrlPropertievs, ).property('commit.authorEmail') buildStateDidChange: (-> - @send('faviconStateDidChange', @get('build.state')) + if @get('sendFaviconStateChanges') + @send('faviconStateDidChange', @get('build.state')) ).observes('build.state') `export default Controller` diff --git a/app/routes/job.coffee b/app/routes/job.coffee index f5b39c25..e207df5f 100644 --- a/app/routes/job.coffee +++ b/app/routes/job.coffee @@ -20,13 +20,24 @@ Route = TravisRoute.extend if build = model.get('build') build = @store.recordForId('build', build.get('id')) - @controllerFor('build').set('build', build) + buildController = @controllerFor('build') + + # this is a hack to not set favicon changes from build + # controller while we're viewing job, this should go away + # after refactoring of controllers + buildController.set('sendFaviconStateChanges', false) + + buildController.set('build', build) model: (params) -> @store.find('job', params.job_id) deactivate: -> + buildController = @controllerFor('build') + buildController.set('sendFaviconStateChanges', true) @controllerFor('build').set('build', null) @controllerFor('job').set('job', null) + @_super.apply(this, arguments) + `export default Route`