Render builds/not_found and repo/not_found in the next runloop run

This is done to make sure that if something else render just after
not_found, not_found will still be rendered.
This commit is contained in:
Piotr Sarnacki 2013-06-13 16:08:06 +02:00
parent 6a9510413d
commit 7363a1d7ef

View File

@ -124,7 +124,8 @@ Travis.SetupLastBuild = Ember.Mixin.create
# TODO: it would be nicer to do it with promises
repo = @controllerFor('repo').get('repo')
if repo && repo.get('isLoaded') && !repo.get('lastBuild')
@render('builds/not_found', outlet: 'pane', into: 'repo')
Ember.run.next =>
@render('builds/not_found', outlet: 'pane', into: 'repo')
Travis.GettingStartedRoute = Ember.Route.extend
setupController: ->
@ -281,7 +282,8 @@ Travis.RepoRoute = Ember.Route.extend
proxy.set 'isLoading', false
if repos.get('length') == 0
self.render('repos/not_found', outlet: 'main')
Ember.run.next ->
self.render('repos/not_found', outlet: 'main')
else
proxy.set 'content', repos.objectAt(0)