mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (panel.url_path === "lovelace") {
|
||||||
|
return hass.localize("panel.states");
|
||||||
|
}
|
||||||
|
|
||||||
if (panel.url_path === "profile") {
|
if (panel.url_path === "profile") {
|
||||||
return hass.localize("panel.profile");
|
return hass.localize("panel.profile");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return hass.localize(`panel.${panel.title}`) || panel.title || undefined;
|
||||||
hass.localize(`panel.${panel.title}`) ||
|
|
||||||
panel.title ||
|
|
||||||
// default panel
|
|
||||||
(hass.panels[localStorage.defaultPage] || hass.panels[DEFAULT_PANEL]).title!
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user