mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Fix Default Lovelace Panel Title (#5301)
* Fix lovelace panel title * Fix types error * Revert and workaround null type * Update src/data/panel.ts Co-Authored-By: Bram Kragten <mail@bramkragten.nl> * Update panel.ts * Update panel.ts Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
ed51223226
commit
6aae1b3378
@ -22,14 +22,13 @@ export const getPanelTitle = (hass: HomeAssistant): string | undefined => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel.url_path === "lovelace") {
|
||||
return hass.localize("panel.states");
|
||||
}
|
||||
|
||||
if (panel.url_path === "profile") {
|
||||
return hass.localize("panel.profile");
|
||||
}
|
||||
|
||||
return (
|
||||
hass.localize(`panel.${panel.title}`) ||
|
||||
panel.title ||
|
||||
// default panel
|
||||
(hass.panels[localStorage.defaultPage] || hass.panels[DEFAULT_PANEL]).title!
|
||||
);
|
||||
return hass.localize(`panel.${panel.title}`) || panel.title || undefined;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user