No idea, but it seems to work? (#2526)

This commit is contained in:
Bram Kragten 2019-01-21 18:17:51 +01:00 committed by Paulus Schoutsen
parent 0e1eaa18df
commit 9a86b06092
2 changed files with 6 additions and 1 deletions

View File

@ -50,11 +50,13 @@ export class HomeAssistant extends ext(PolymerElement, [
route="[[route]]"
pattern="/:panel"
data="{{routeData}}"
tail="{{subroute}}"
></app-route>
<template is="dom-if" if="[[showMain]]" restamp>
<home-assistant-main
hass="[[hass]]"
route="[[route]]"
tail="[[subroute]]"
></home-assistant-main>
</template>

View File

@ -81,6 +81,9 @@ class HomeAssistantMain extends NavigateMixin(EventsMixin(PolymerElement)) {
return {
hass: Object,
narrow: Boolean,
tail: {
type: Object,
},
route: {
type: Object,
observer: "_routeChanged",
@ -135,7 +138,7 @@ class HomeAssistantMain extends NavigateMixin(EventsMixin(PolymerElement)) {
connectedCallback() {
super.connectedCallback();
if (this.route.prefix === "") {
if (this.tail.prefix === "") {
this.navigate(`/${localStorage.defaultPage || DEFAULT_PANEL}`, true);
}
}