Fix panels with subpaths (#2528)

This commit is contained in:
Paulus Schoutsen 2019-01-21 21:16:34 -08:00 committed by GitHub
parent 6d329bdd1f
commit 547f829f5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,10 +177,16 @@ class PartialPanelResolver extends LitElement {
// Manual splitting
const route = this.route!;
const dividerPos = route.path.indexOf("/", 1);
this._routeTail = {
prefix: route.path.substr(0, dividerPos),
path: route.path.substr(dividerPos),
};
this._routeTail =
dividerPos === -1
? {
prefix: route.path,
path: "",
}
: {
prefix: route.path.substr(0, dividerPos),
path: route.path.substr(dividerPos),
};
// If just route changed, no need to process further.
if (changedProps.size === 1) {