mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 11:01:38 -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
|
// Controller for post pages
|
||||||
|
|
||||||
PostPageController = FastRender.RouteController.extend({
|
PostPageController = FastRender.RouteController.extend({
|
||||||
loadSubscriptions: function() {
|
waitOn: function() {
|
||||||
this.postSubscription = coreSubscriptions.subscribe('singlePost', this.params._id);
|
return [
|
||||||
this.commentSubscription = coreSubscriptions.subscribe('postComments', this.params._id);
|
coreSubscriptions.subscribe('singlePost', this.params._id),
|
||||||
this.postUsersSubscription = coreSubscriptions.subscribe('postUsers', this.params._id);
|
coreSubscriptions.subscribe('postComments', this.params._id),
|
||||||
|
coreSubscriptions.subscribe('postUsers', this.params._id)
|
||||||
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
post: function() {
|
post: function() {
|
||||||
|
@ -368,16 +370,11 @@ PostPageController = FastRender.RouteController.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
onBeforeAction: function(pause) {
|
onBeforeAction: function(pause) {
|
||||||
this.loadSubscriptions();
|
if (this.ready()) {
|
||||||
|
if(!this.post()) {
|
||||||
if (! this.post()) {
|
this.render('not_found');
|
||||||
if (this.postSubscription.ready()) {
|
|
||||||
this.render('notFound');
|
|
||||||
return pause();
|
return pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.render('loading');
|
|
||||||
pause();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue