mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00
Handle case where Pages collection isn't loaded yet (although that should never happen…)
This commit is contained in:
parent
067d1eb398
commit
4d9fdf55de
1 changed files with 5 additions and 2 deletions
|
@ -7,11 +7,14 @@ Telescope.config.adminMenu.push({
|
|||
Telescope.config.preloadSubscriptions.push('pages');
|
||||
|
||||
PageController = RouteController.extend({
|
||||
currentPage: function () {
|
||||
return Pages.collection.findOne({slug: this.params.slug});
|
||||
},
|
||||
getTitle: function () {
|
||||
return Pages.collection.findOne({slug: this.params.slug}).title;
|
||||
return this.currentPage() && this.currentPage().title;
|
||||
},
|
||||
data: function () {
|
||||
return Pages.collection.findOne({slug: this.params.slug});
|
||||
return this.currentPage();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue