mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 10:33:38 +08:00
DEV: nav-item should not fail when no top menu items exist
This can be called from themes where anonymous_top_menu_items is not set cause the site requires login Bail out cleanly if that is the case
This commit is contained in:
parent
2cca14d510
commit
57bb553499
|
@ -150,11 +150,12 @@ NavItem.reopenClass({
|
|||
|
||||
opts = opts || {};
|
||||
|
||||
if (
|
||||
anonymous &&
|
||||
!Site.currentProp("anonymous_top_menu_items").includes(filterType)
|
||||
)
|
||||
return null;
|
||||
if (anonymous) {
|
||||
const topMenuItems = Site.currentProp("anonymous_top_menu_items");
|
||||
if (!topMenuItems || !topMenuItems.includes(filterType)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Category.list() && filterType === "categories") return null;
|
||||
if (!Site.currentProp("top_menu_items").includes(filterType)) return null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user