[kbnUrl] reload the route when going from "" to "/"

In timelion the initial route is set to '' which might not be perfectly correct, but works fine. When clicking the "new" button for the first time this causes the route to update from '' to '/', which the kbnUrl service assumes will cause a route change and does not try to force the route to reload. Instead, the router sees this as a noop and the change to the route has no effect unless you click the "new" button a second time.
This commit is contained in:
spalger 2016-10-24 13:43:40 -07:00
parent 5dc4afbc8d
commit a7304ec425

View file

@ -186,7 +186,11 @@ function KbnUrlProvider($injector, $location, $rootScope, $parse, Private) {
let route = $route.current && $route.current.$$route;
if (!route) return false;
if (next.path !== prev.path) return false;
// for the purposes of determining wether there will be a reload,
// '' and '/' are equal
const nextPath = next.path || '/';
const prevPath = prev.path || '/';
if (nextPath !== prevPath) return false;
let reloadOnSearch = route.reloadOnSearch;
let searchSame = _.isEqual(next.search, prev.search);