Default view (#1349)

* Do not rebuild config twice on tab change

* Allow setting default page
This commit is contained in:
Paulus Schoutsen 2018-06-27 14:18:58 -04:00 committed by GitHub
parent 20e92893e0
commit 654e74294d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -111,7 +111,7 @@ class HomeAssistantMain extends NavigateMixin(EventsMixin(PolymerElement)) {
super.connectedCallback(); super.connectedCallback();
window.removeInitMsg(); window.removeInitMsg();
if (document.location.pathname === '/') { if (document.location.pathname === '/') {
this.navigate('/states', true); this.navigate(`/${localStorage.defaultPage || 'states'}`, true);
} }
} }

View File

@ -149,7 +149,6 @@ class HUIRoot extends NavigateMixin(EventsMixin(PolymerElement)) {
if (index !== this._curView) { if (index !== this._curView) {
const id = this.config.views[index].id || index; const id = this.config.views[index].id || index;
this.navigate(`/lovelace/${id}`); this.navigate(`/lovelace/${id}`);
this._selectView(index);
} }
} }