FIX: Build correct NavItem URL (#47)

FIX: Build correct NavItem URL (#47)

diff --git a/assets/javascripts/discourse/initializers/discourse-voting.js.es6 b/assets/javascripts/discourse/initializers/discourse-voting.js.es6
index b31f3a2..708e84c 100644
--- a/assets/javascripts/discourse/initializers/discourse-voting.js.es6
+++ b/assets/javascripts/discourse/initializers/discourse-voting.js.es6
@@ -18,7 +18,7 @@ export default {
             const currentFilterType = (args.filterMode || "").split("/").pop();
             const path = NavItem.pathFor(currentFilterType, args);
 
-            return `${path}?order=votes`;
+            return `${path.replace(/\/l\/$/, "")}?order=votes`;
           },
           forceActive: (category, args, router) => {
             const queryParams = router.currentRoute.queryParams;

GitHub sha: e437b603

The replace feels a bit odd , is this related to routing changes @danielwaterworth made?

2 Likes

It is indeed. I think this would be better fixed in core.

2 Likes

Can you follow this up or guide @nbianca here at the core fix?