diff --git a/lib/router.js b/lib/router.js index ab899710a..7579df674 100644 --- a/lib/router.js +++ b/lib/router.js @@ -357,10 +357,12 @@ PostsDigestController = FastRender.RouteController.extend({ // Controller for post pages PostPageController = FastRender.RouteController.extend({ - loadSubscriptions: function() { - this.postSubscription = coreSubscriptions.subscribe('singlePost', this.params._id); - this.commentSubscription = coreSubscriptions.subscribe('postComments', this.params._id); - this.postUsersSubscription = coreSubscriptions.subscribe('postUsers', this.params._id); + waitOn: function() { + return [ + coreSubscriptions.subscribe('singlePost', this.params._id), + coreSubscriptions.subscribe('postComments', this.params._id), + coreSubscriptions.subscribe('postUsers', this.params._id) + ]; }, post: function() { @@ -368,16 +370,11 @@ PostPageController = FastRender.RouteController.extend({ }, onBeforeAction: function(pause) { - this.loadSubscriptions(); - - if (! this.post()) { - if (this.postSubscription.ready()) { - this.render('notFound'); + if (this.ready()) { + if(!this.post()) { + this.render('not_found'); return pause(); } - - this.render('loading'); - pause(); } },