FIX: currentURL is unstable for in route transitions

If you transition just using query params but leave the rest of the route
alone, sometimes router.currentURL will not update.

This in turn causes active not to work correctly.
This commit is contained in:
Sam Saffron 2019-11-06 16:36:26 +11:00
parent 0cea63029c
commit b4d8001dc8
1 changed files with 6 additions and 3 deletions

View File

@ -69,10 +69,13 @@ function initialize(api) {
}
},
forceActive: (category, args, router) => {
const queryParams = router.currentRoute.queryParams;
return (
router.currentURL &&
router.currentURL.indexOf("assigned=nobody") > -1 &&
router.currentURL.indexOf("status=open") > -1
queryParams &&
Object.keys(queryParams).length === 2 &&
queryParams["assigned"] === "nobody" &&
queryParams["status"] === "open"
);
},
before: "top"