From ef40b46611a01c4d5a4ae558530a2e0e8008e1e5 Mon Sep 17 00:00:00 2001 From: Faizaan Gagan Date: Mon, 16 Mar 2020 17:42:04 +0530 Subject: [PATCH] DEV: fix "addNavigationBarItem" documentation (#9207) * the filter should return the boolean result * custom href should return the relative url value --- app/assets/javascripts/discourse/lib/plugin-api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/plugin-api.js b/app/assets/javascripts/discourse/lib/plugin-api.js index cdaaad0263c..9439b16319e 100644 --- a/app/assets/javascripts/discourse/lib/plugin-api.js +++ b/app/assets/javascripts/discourse/lib/plugin-api.js @@ -755,8 +755,8 @@ class PluginApi { * displayName: "bugs" * href: "/c/bugs", * init: (navItem, category) => { if (category) { navItem.set("category", category) } } - * customFilter: (category, args, router) => { category && category.name !== 'bug' } - * customHref: (category, args, router) => { if (category && category.name) === 'not-a-bug') "/a-feature"; }, + * customFilter: (category, args, router) => { return category && category.name !== 'bug' } + * customHref: (category, args, router) => { if (category && category.name) === 'not-a-bug') return "/a-feature"; }, * before: "top", * forceActive(category, args, router) => router.currentURL === "/a/b/c/d"; * })