mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 12:26:35 +00:00
When /states/bad_view is selected - fall back to default view. (#1002)
This commit is contained in:
parent
860860099e
commit
b03c361198
@ -183,7 +183,7 @@
|
||||
|
||||
currentView: {
|
||||
type: String,
|
||||
computed: '_computeCurrentView(routeMatch, routeData)',
|
||||
computed: '_computeCurrentView(hass, routeMatch, routeData)',
|
||||
},
|
||||
|
||||
views: {
|
||||
@ -288,8 +288,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
_computeCurrentView(routeMatch, routeData) {
|
||||
return routeMatch ? routeData.view : '';
|
||||
_computeCurrentView(hass, routeMatch, routeData) {
|
||||
if (!routeMatch) return '';
|
||||
if (!hass.states[routeData.view] || !hass.states[routeData.view].attributes.view) {
|
||||
return '';
|
||||
}
|
||||
return routeData.view;
|
||||
}
|
||||
|
||||
computeTitle(views, defaultView, locationName) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user