From e98d94f17fb51448534d9b27aa81229da680cf1d Mon Sep 17 00:00:00 2001 From: Daniel Waterworth Date: Wed, 13 Nov 2019 16:21:07 +0000 Subject: [PATCH] DEV: Commas in top_menu items are no longer used According to eviltrout, commas and pipes were the delimiters of a Discourse specific microformat, but this is no longer the case and hasn't been for some time. --- app/assets/javascripts/discourse/models/nav-item.js.es6 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/models/nav-item.js.es6 b/app/assets/javascripts/discourse/models/nav-item.js.es6 index a198df2e896..d76df548327 100644 --- a/app/assets/javascripts/discourse/models/nav-item.js.es6 +++ b/app/assets/javascripts/discourse/models/nav-item.js.es6 @@ -99,9 +99,7 @@ NavItem.reopenClass({ // create a nav item from the text, will return null if there is not valid nav item for this particular text fromText(text, opts) { - var split = text.split(","), - name = split[0], - testName = name.split("/")[0], + var testName = text.split("/")[0], anonymous = !Discourse.User.current(); opts = opts || {}; @@ -116,7 +114,7 @@ NavItem.reopenClass({ if (!Discourse.Site.currentProp("top_menu_items").includes(testName)) return null; - var args = { name: name, hasIcon: name === "unread" }; + var args = { name: text, hasIcon: text === "unread" }; if (opts.category) { args.category = opts.category; }