mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00
fixed posts 404 implementation
This commit is contained in:
parent
10e38bc455
commit
8a1bf9dc7f
1 changed files with 9 additions and 12 deletions
|
@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue