mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
fix user not defined issue in user menu
This commit is contained in:
parent
94b3b874d4
commit
975439cdd9
2 changed files with 7 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
getRoute = function (item) {
|
||||
// if route is a Function return its result, else apply Router.path() to it
|
||||
return typeof item.route == "function" ? item.route() : Router.path(item.route);
|
||||
}
|
||||
return typeof item.route === "function" ? item.route() : Router.path(item.route);
|
||||
};
|
||||
|
||||
// filter out admin-only items if needed
|
||||
getMenuItems = function (menu) {
|
||||
|
@ -14,7 +14,7 @@ getMenuItems = function (menu) {
|
|||
}
|
||||
|
||||
return menuItems;
|
||||
}
|
||||
};
|
||||
|
||||
Template.menuComponent.helpers({
|
||||
getMenuItems: function () {
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
Telescope.menuItems.add("userMenu", [
|
||||
{
|
||||
route: function () {
|
||||
return Router.path('user_profile', {_idOrSlug: Meteor.user().telescope.slug});
|
||||
var user = Meteor.user();
|
||||
return Router.path('user_profile', {_idOrSlug: user && user.telescope.slug});
|
||||
},
|
||||
label: 'profile',
|
||||
description: 'view_your_profile'
|
||||
},
|
||||
{
|
||||
route: function () {
|
||||
return Router.path('user_edit', {slug: Meteor.user().telescope.slug});
|
||||
var user = Meteor.user();
|
||||
return Router.path('user_edit', {slug: user && user.telescope.slug});
|
||||
},
|
||||
label: 'edit_account',
|
||||
description: 'edit_your_profile'
|
||||
|
|
Loading…
Add table
Reference in a new issue